mindspore.ops.Ceil

class mindspore.ops.Ceil[source]

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

Refer to mindspore.ops.ceil() for more details.

Inputs:
  • x (Tensor) - The input tensor. Its element data type must be float16 or float32. \((N,*)\) where \(*\) means, any number of additional dimensions.

Outputs:

Tensor, has the same shape as x.

Supported Platforms:

Ascend GPU CPU

Examples

>>> x = Tensor(np.array([1.1, 2.5, -1.5]), mindspore.float32)
>>> ceil_op = ops.Ceil()
>>> output = ceil_op(x)
>>> print(output)
[ 2.  3. -1.]