I’ve encountered the following, and looking for an explanation
import torch
print(torch.__version__)
1.3.1
a = torch.tensor([[1]])
b = torch.tensor(1)
print(a.shape, b.shape)
torch.Size([1, 1]), torch.Size([])
print(a == b)
tensor([[True]])