设计
规格
API
API映射
迁移指南
FAQ
RELEASE NOTES
对输入数据进行四舍五入到最接近的整数数值。
x (Tensor) - 输入Tensor。
Tensor,shape和数据类型与输入 x 相同。
TypeError - x 不是Tensor。
Ascend GPU CPU
Ascend
GPU
CPU
样例:
>>> x = Tensor(np.array([0.8, 1.5, 2.3, 2.5, -4.5]), mindspore.float32) >>> output = ops.round(x) >>> print(output) [ 1. 2. 2. 2. -4.]