you can use torch. eq ( input ,  other ,  out=None ) → Tensor .But torch.eq() only returns   torch.ByteTensor with (0/1)s not bool vaule. There is another function torch. equal ( tensor1 ,  tensor2 ) → bool, but it doesn’t do broadcasting, only return  a single bool value with shape 1.
a = torch.tensor([1, 2, 3])
b = torch.tensor([1])
c = torch.eq(a, b)
# c is a tensor([1, 0, 0], dtype=torch.uint8)
d = c.numpy().astype('bool') 
# d is a array([ True, False, False], dtype=bool)

In pytorch, there are 100+ Tensor operations including transposing, indexing, slicing, mathematical operations, linear algebra, random numbers, etc., are described here 35.