floor_divide( x, y, name=None )
Floor divide two tensors element-wise. The equation is:\[out = x // y\]
paddle.floor_dividesupports broadcasting. If you want know more about broadcasting, please refer to Broadcasting .
x (Tensor) – the input tensor, it’s data type should be int32, int64.
y (Tensor) – the input tensor, it’s data type should be int32, int64.
name (str, optional) – Name for the operation (optional, default is None). For more information, please refer to Name.
N-D Tensor. A location into which the result is stored. It’s dimension equals with $x$.
import paddle x = paddle.to_tensor([2, 3, 8, 7]) y = paddle.to_tensor([1, 5, 3, 3]) z = paddle.floor_divide(x, y) print(z) # [2, 0, 2, 2]