PyTorch torch.floor_divide function
PyTorch torch reference manual
torch.floor_divide A function in PyTorch for element-wise integer division.
Function definition
torch.floor_divide(input, other, *, out=None)
Usage examples
Example
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
)
(
result
)