PyTorch torch.floor_divide Function
Pytorch torch Reference Manual
torch.floor_divideIt is a function in PyTorch used for element-wise integer division.
Function Definition
torch.floor_divide(input, other, *, out=None)
Usage Examples
Examples
import torch
# Integer Division Example
x = torch.tensor([10.0, 20.0, 30.0, 40.0])
y = torch.tensor([3.0, 3.0, 3.0, 3.0])
result = torch.floor_divide(x, y)
print(result) # tensor([3., 6., 10., 13.])
# Integer Division Example
x = torch.tensor([10.0, 20.0, 30.0, 40.0])
y = torch.tensor([3.0, 3.0, 3.0, 3.0])
result = torch.floor_divide(x, y)
print(result) # tensor([3., 6., 10., 13.])
Other Extensions