mindspore.ops.tan

mindspore.ops.tan(x)[source]

Computes tangent of x element-wise.

\[out_i = tan(x_i)\]
Parameters

x (Tensor) – The input Tensor, valid for any dimensions.

Returns

Tensor, has the same shape as x.

Raises

TypeError – If x is not a Tensor.

Supported Platforms:

Ascend CPU GPU

Examples

>>> x = Tensor(np.array([-1.0, 0.0, 1.0]), mindspore.float32)
>>> output = ops.tan(x)
>>> print(output)
[-1.5574081 0. 1.5574081]