mindspore.mint.floor

mindspore.mint.floor(input)[source]

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

\[out_i = \lfloor input_i \rfloor\]
Parameters

input (Tensor) –

The input tensor. Its supported data types are:

  • Ascend: float16, float32, float64, bfloat16, int8, int16, int32, int64, uint8, uint16, uint32, uint64.

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.floor(input)
>>> print(output)
[ 1.  2. -2.]