PyTorch torch.lt function
PyTorch torch reference manual
torch.lt is a function in PyTorch used for element-wise less-than comparison.
Function definition
torch.lt(input, other, out)
Usage examples
Example
import
torch
a
=
torch.
tensor
(
[
1
,
2
,
3
,
4
]
)
b
=
torch.
tensor
(
[
2
,
2
,
2
,
2
]
)
result
=
torch.
lt
(
a
,
b
)
(
result
)
The output is:
tensor([ True, False, False, False])