mindspore.ops.frac

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

Return the fractional part of each element in the input tensor.

Parameters

x (Tensor) – The input tensor.

Returns

Tensor

Supported Platforms:

Ascend GPU CPU

Examples

>>> import mindspore
>>> input = mindspore.tensor([2, 4.2, -2.5])
>>> output = mindspore.ops.frac(input)
>>> print(output)
[ 0.          0.19999981 -0.5       ]