paddle. deg2rad ( x, name=None ) [source]
Convert each of the elements of input x from degrees to angles in radians.
$deg2rad(x)=\pi * x / 180$
Parameters
• x (Tensor) – An N-D Tensor, the data type is float32, float64, int32, int64.

• name (str, optional) – Name for the operation (optional, default is None). For more information, please refer to Name.

Returns

An N-D Tensor, the shape and data type is the same with input (The output data type is float32 when the input data type is int).

Return type

out (Tensor)

Examples

import paddle
x1 = paddle.to_tensor([180.0, -180.0, 360.0, -360.0, 90.0, -90.0])