Pytorch Torch Greater
# PyTorch torch.greater Function
* * PyTorch torch Reference Manual](#)
`torch.greater` is a PyTorch function for element-wise comparison of "greater than". It returns a tensor with True values where elements of the first tensor are greater than corresponding elements of the second tensor.
### Function Definition
torch.greater(input, other)
* * *
## Example Usage
## Example
import torch
# Create two tensors
x = torch.tensor([3,5,2])
y = torch.tensor([2,4,2])
# Element-wise greater comparison
result = torch.greater(x, y)
print(result)
Output result:
tensor([True, True, False])
* * PyTorch torch Reference Manual](#)
AI Processing...
[](#)(#)
[PyTorch torch.nn Reference Manual](#)[](#)
YouTip