返回输入tensor中每个元素的小数部分。
x (Tensor) - 输入tensor。
Tensor
Ascend GPU CPU
Ascend
GPU
CPU
样例:
>>> import mindspore >>> input = mindspore.tensor([2, 4.2, -2.5]) >>> output = mindspore.ops.frac(input) >>> print(output) [ 0. 0.19999981 -0.5 ]