PyTorch torch.lt Function
PyTorch torch Reference Manual
torch.ltis a function in PyTorch used for element-wise less-than comparison.
Function Definition
torch.lt(input, other, out)
Usage Example
Example
import torch
a = torch.tensor([1, 2, 3, 4])
b = torch.tensor([2, 2, 2, 2])
result = torch.lt(a, b)
print(result)
a = torch.tensor([1, 2, 3, 4])
b = torch.tensor([2, 2, 2, 2])
result = torch.lt(a, b)
print(result)
The output result is:
tensor([ True, False, False, False])
Other Extensions