mindspore.ops.frac

mindspore.ops.frac(x)[source]

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

Warning

Starting after version 2.9.0, this interface will undergo a non-compatible change: The parameter x will be renamed to input.

The updated signature will be mindspore.ops.frac(input).

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       ]