mindspore.ops.tan

mindspore.ops.tan(input)[source]

Computes tangent of input element-wise.

\[out_i = tan(input_i)\]
Parameters

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

Returns

Tensor, has the same shape as input.

Raises

TypeError – If input is not a Tensor.

Supported Platforms:

Ascend GPU CPU

Examples

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