mindspore.Tensor.trunc
- mindspore.Tensor.trunc()
详情请参考
mindspore.ops.trunc()
。- 支持平台:
Ascend
GPU
CPU
样例:
>>> import mindspore >>> import numpy as np >>> from mindspore import Tensor >>> x = Tensor(np.array([3.4742, 0.5466, -0.8008, -3.9079]),mindspore.float32) >>> output = x.trunc() >>> print(output) [3. 0. 0. -3.]