mindspore.numpy.sin

mindspore.numpy.sin(x, dtype=None)[源代码]

Trigonometric sine, element-wise.

Note

Numpy arguments out, where, casting, order, subok, signature, and extobj are not supported.

Parameters
  • x (Tensor) – Input tensor.

  • dtype (mindspore.dtype, optional) – Default: None. Overrides the dtype of the output Tensor.

Returns

Tensor or scalar. This is a scalar if x is a scalar.

Supported Platforms:

Ascend GPU CPU

Examples

>>> import mindspore.numpy as np
>>> x = np.array([-5, -1, 0, 2, 4, 100]).astype('float32')
>>> output = np.sin(x)
>>> print(output)
[ 0.9589243  -0.84147096  0.   0.9092974  -0.7568025  -0.50636566]