Santosh-Gupta:

I am wondering why this is?


I think because an arbitrary manipulation is not a valid operation, which would yield valid gradients.
Have a look at this dummy example:
x = torch.randn(1)
w = torch.randn(1, requires_grad=True)

y = x*w
#w[0] = 1.
y.backward()
print(w.grad)

If you uncomment the particular line, you’ll get an error.



 Santosh-Gupta:

Is there any other reasons for this besides the autograd thing?


Note that manipulating the .data might yield a wrong result in your calculations, which I would consider a strong argument against using this approach.