mindspore.Tensor.tan

Tensor.tan()[source]

Computes tangent of x element-wise.

\[out_i = tan(x_i)\]
Returns

Tensor, has the same shape as self.

Raises

TypeError – If self is not a Tensor.

Supported Platforms:

Ascend GPU CPU

Examples

>>> from mindspore import Tensor
>>> a = Tensor([-1.0, 0.0, 1.0]).astype("float32")
>>> output = a.tan()
>>> print(output)
[-1.5574081 0. 1.5574081]