mindspore.ops.rad2deg

View Source On Gitee
mindspore.ops.rad2deg(x)[source]

Converts angles in radians to angles in degrees element-wise.

Parameters

x (Tensor) – The input tensor.

Returns

Tensor, has the same shape and dtype as the x.

Raises
  • TypeError – If x is not a Tensor.

  • TypeError – If dtype of x isn't float16, float32 or float64.

Supported Platforms:

Ascend GPU CPU

Examples

>>> import mindspore
>>> from mindspore import Tensor
>>> from mindspore import ops
>>> x = Tensor([[6.283, -3.142],[1.570, -6.283],[3.142, -1.570]], mindspore.float32)
>>> output = ops.rad2deg(x)
>>> print(output)
[[ 359.98935 -180.02333]
 [  89.95438 -359.98935]
 [ 180.02333  -89.95438]]