maxframe.tensor.degrees#

maxframe.tensor.degrees(x, out=None, where=None, **kwargs)[源代码]#

将角度从弧度转换为度。

参数:
  • x (array_like) -- 以弧度为单位的输入张量。

  • out (Tensor, None, or tuple of Tensor and None, optional) -- 用于存储结果的位置。如果提供,其形状必须与输入广播一致。如果未提供或为 None,则返回一个新分配的张量。元组(只能作为关键字参数)的长度必须等于输出的数量。

  • where (array_like, optional) -- 值为 True 表示在该位置计算 ufunc,值为 False 表示保留输出中的值不变。

  • **kwargs

返回:

y -- 对应的度数值;如果提供了 out,则这是对它的引用。

返回类型:

Tensor of floats

参见

rad2deg

等效函数

示例

将弧度数组转换为度

>>> import maxframe.tensor as mt
>>> rad = mt.arange(12.)*mt.pi/6
>>> mt.degrees(rad).execute()
array([   0.,   30.,   60.,   90.,  120.,  150.,  180.,  210.,  240.,
        270.,  300.,  330.])
>>> out = mt.zeros((rad.shape))
>>> r = mt.degrees(out)
>>> mt.all(r == out).execute()
True