PyTorch torch.greater_equal function
PyTorch torch reference manual
torch.greater_equal A function in PyTorch for element-wise greater-than-or-equal comparison. Returns a tensor that is True where elements of the first tensor are greater than or equal to the corresponding elements of the second tensor.
Function definition
torch.greater_equal(input, other)
Usage examples
Example
import
torch
Create two tensors
x
=
torch.
tensor
(
[
3
,
5
,
2
]
)
y
=
torch.
tensor
(
[
2
,
4
,
2
]
)
Element-wise greater-than-or-equal comparison
result
=
torch.
greater_equal
(
x
,
y
)
(
result
)
The output is:
tensor([True, True, True])