mindspore.ops.Ceilο
- class mindspore.ops.Ceil(*args, **kwargs)[source]ο
Rounds a tensor up to the closest integer element-wise.
\[out_i = \lceil x_i \rceil = \lfloor x_i \rfloor + 1\]- Inputs:
input_x (Tensor) - The input tensor. Itβs element data type must be float16 or float32.
- Outputs:
Tensor, has the same shape as input_x.
- Raises
TypeError β If dtype of input_x is neither float16 nor float32.
- Supported Platforms:
Ascend
Examples
>>> input_x = Tensor(np.array([1.1, 2.5, -1.5]), mindspore.float32) >>> ceil_op = ops.Ceil() >>> output = ceil_op(input_x) >>> print(output) [ 2. 3. -1.]