mindspore.numpy.radians

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

Converts angles from degrees to radians.

参数
  • x (Tensor) – Angles in degrees.

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

返回

Tensor, the corresponding radian values. This is a tensor scalar if x is a tensor scalar.

异常

TypeError – If x is not a tensor.

Supported Platforms:

Ascend GPU CPU

样例

>>> import mindspore.numpy as np
>>> x = np.asarray([1, 2, 3, -4, -5])
>>> output = np.radians(x)
>>> print(output)
[ 0.01745329  0.03490658  0.05235988 -0.06981317 -0.08726647]