mindspore.ops.Round

class mindspore.ops.Round[source]

Returns half to even of a tensor element-wise.

Refer to mindspore.ops.round() for more detailsed.

Supported Platforms:

Ascend GPU CPU

Examples

>>> x = Tensor(np.array([0.8, 1.5, 2.3, 2.5, -4.5]), mindspore.float32)
>>> round = ops.Round()
>>> output = round(x)
>>> print(output)
[ 1.  2.  2.  2. -4.]