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