Hi Guys,
I am trying to run out.backward(torch.Tensor([2.0])) and I get a error shape mismatch, (which makes sense) but I am try to run the same in Pytorch 1.0.2 it is working if I print grad post this operation elements in the matrix get multiplied by 2.0.
out.backward(torch.tensor([2.0])) throws error
RuntimeError: Mismatch in shape: grad_output[0] has a shape of torch.Size([1]) and output[0] has a shape of torch.Size([]).
Infact, out.backward(torch.tensor([1.0])) doesn’t work as well in the latest version.