PyTorch torch.le function
PyTorch torch reference manual
torch.le is a function in PyTorch used for element-wise less-than-or-equal comparison.
Function definition
torch.le(input, other, out)
Usage examples
Example
import
torch
Element-wise less-than-or-equal comparison
x
=
torch.
tensor
(
[
1
,
2
,
3
,
4
]
)
y
=
torch.
tensor
(
[
2
,
2
,
2
,
5
]
)
result
=
torch.
le
(
x
,
y
)
(
result
)