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

PyTorch torch.floor function

PyTorch torch.floor function


PyTorch torch reference manual PyTorch torch reference manual

torch.floor A function in PyTorch for element-wise floor (rounding down).

Function definition

torch.floor(input, out=None)


Usage examples

Example

import

torch

x

=

torch.

tensor

(

[

1.1

,

2.5

,

3.7

,

1.2

]

)

print

(

torch.

floor

(

x

)

)

The output is:

tensor([1., 2., 3., -2.])


PyTorch torch reference manual PyTorch torch reference manual