The torch.Tensor usage is deprecated, so I’ve used this as a check (which creates tensors with a single value):
x1 = torch.tensor([3.], requires_grad=True)
x2 = torch.tensor([5.], requires_grad=True)
a = torch.mul(x1, x2)
print(a) # works

x1 = torch.tensor([3.], requires_grad=True)
x2 = torch.tensor([5.], requires_grad=True)
x1.names=('x1',)
x2.names=('x2',)
a = torch.mul(x1, x2)
> RuntimeError: Error when attempting to broadcast dims ['x1'] and dims ['x2']: dim 'x1' and dim 'x2' are at the same position from the right but do not match.