mindspore.Tensor.ceil

Tensor.ceil()[source]

Rounds a tensor up to the closest integer element-wise.

Returns

Tensor.

Raises

TypeError – If dtype of self tensor is not float16 or float32.

Supported Platforms:

Ascend GPU CPU

Examples

>>> from mindspore import Tensor
>>> a = Tensor([1.1, 2.5, -1.5]).astype("float32")
>>> output = a.ceil()
>>> print(output)
[ 2.  3. -1.]