How to fix Mismatch in shape when using .backward() function

Hi,

The error is not very clear but it happens because we recently introduced 0 sized Tensors.
As you can see, the size mismatch is between a Tensor with 1 dimension of size 1 and a tensor with 0 dimensions that contains a single element.

Could you show how mone is created?
If it is a fixed number, it should be created as torch.tensor(42). If it is created using a reduction function (like sum, mean etc), the keepdim argument should be set to False.