torch.eq(input,other,*,out=None)
computes element-wise equality
The second argument is a tensor or a number whose shape is broadcastable with the first argument.
input(Tensor) - a tensor to compare
other(Tensor or float) - the tensor or value to compare
out(Tensor,optional) - the output tensor
Returns: A boolean tensor that is true where inpute is equal to other, and false elsewhere.
torch.eq(torch.tensor([[1, 2],[3, 4]]), torch.tensor([[1, 1], [4, 4]]))
tensor([[True, False],
[False, True]])