Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PyTorch torch.le function

PyTorch torch.le function


PyTorch torch reference manual 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

)

print

(

result

)


PyTorch torch reference manual PyTorch torch reference manual