mindspore.mint.ceil
- mindspore.mint.ceil(input)[source]
Rounds a tensor up to the closest integer element-wise.
\[out_i = \lceil x_i \rceil = \lfloor x_i \rfloor + 1\]- Parameters
input (Tensor) –
the input of Ceil. Supported dtypes:
Ascend: float16, float32, float64 or bfloat16.
- Returns
Tensor, has the same shape as input.
- Raises
- Supported Platforms:
Ascend
Examples
>>> import mindspore >>> import numpy as np >>> from mindspore import Tensor, mint >>> input = Tensor(np.array([1.1, 2.5, -1.5]), mindspore.float32) >>> output = mint.ceil(input) >>> print(output) [ 2. 3. -1.] >>> input = Tensor(2.1, mindspore.float32) >>> output = mint.ceil(input) >>> print(output) 3.0