mars.tensor.fix#
- mars.tensor.fix(x, out=None, **kwargs)[来源]#
四舍五入到离零最近的整数。
对浮点数的张量进行逐元素向零取整。
取整后的值以浮点数形式返回。- Parameters
x (array_like) – 一个要进行四舍五入的浮点数张量
out (张量, 可选) – 输出张量
- Returns
out – 四舍五入后的数字数组
- Return type
浮点数张量
示例
>>> import mars.tensor as mt
>>> mt.fix(3.14).execute() 3.0 >>> mt.fix(3).execute() 3.0 >>> mt.fix([2.1, 2.9, -2.1, -2.9]).execute() array([ 2., 2., -2., -2.])