PyTorch torch.fix function
PyTorch torch reference manual
torch.fix is a PyTorch function for taking the integer part of each element (rounding toward zero).
Function definition
torch.fix(input, *, out=None)
Usage examples
Example
import
torch
Integer-part example
x
=
torch.
tensor
(
[
1.5
,
0.5
,
0.5
,
1.5
,
2.7
]
)
result
=
torch.
fix
(
x
)
(
result
)