mindspore.ops.frac

查看源文件
mindspore.ops.frac(x)[源代码]

返回输入tensor中每个元素的小数部分。

参数:
  • x (Tensor) - 输入tensor。

返回:

Tensor

支持平台:

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       ]