a = torch.Tensor([1,2,3,4,5])
b = torch.Tensor([4])

print(a.numpy() == np.tile(b.item(), a.size()[0]))
# [False False False  True False]

Is this an answer for your question . It benefits from numpy, but i don’t know full pytorch solution if there is.