If I use a = torch.zeros(2, 2) It gives other errors
But with
a = torch.tensor([[0, 0],[0, 2]], dtype=t.float, requires_grad= True)
It results in the following error. I tried param.clone as well, that also results in same error
RuntimeError: a view of a leaf Variable that requires grad is being used in an in-place operation.