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