mars.tensor.sinh#

mars.tensor.sinh(x, out=None, where=None, **kwargs)[来源]#

超越正弦,逐元素。

等价于 1/2 * (mt.exp(x) - mt.exp(-x))-1j * mt.sin(1j*x).

Parameters
  • x (array_like) – 输入张量。

  • out (Tensor, None, 或 tupleTensor 和 None, 可选) – 结果存储的位置。如果提供,它必须具有和输入相同的广播形状。如果未提供或None,将返回一个新分配的张量。元组(仅作为关键字参数可能)必须具有与输出数量相等的长度。

  • where (array_like, 可选) – 值为 True 表示在该位置计算 ufunc,值为 False 表示保持输出中的该值不变。

  • **kwargs

Returns

y – 对应的双曲正弦值。

Return type

张量

备注

如果 out 被提供,函数将结果写入其中,并返回对 out 的引用。 (参见示例)

参考文献

M. Abramowitz 和 I. A. Stegun,《数学函数手册》。纽约,NY: Dover, 1972,第83页。

示例

>>> import mars.tensor as mt
>>> mt.sinh(0).execute()
0.0
>>> mt.sinh(mt.pi*1j/2).execute()
1j
>>> mt.sinh(mt.pi*1j).execute() # (exact value is 0)
1.2246063538223773e-016j
>>> # Discrepancy due to vagaries of floating point arithmetic.
>>> # Example of providing the optional output parameter
>>> out1 = mt.zeros(1)
>>> out2 = mt.sinh([0.1], out1)
>>> out2 is out1
True
>>> # Example of ValueError due to provision of shape mis-matched `out`
>>> mt.sinh(mt.zeros((3,3)),mt.zeros((2,2))).execute()
Traceback (most recent call last):
...
ValueError:  operands could not be broadcast together with shapes (3,3) (2,2)