Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PyTorch torch.floor_divide function

PyTorch torch.floor_divide function

PyTorch torch.floor_divide function


PyTorch torch reference manual 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

)

print

(

result

)

 

tensor([3., 6., 10., 13.])


PyTorch torch reference manual PyTorch torch reference manual