But what about this code snippet?
from torch.autograd import Variable

invar = Variable(torch.rand(5, 5), requires_grad=True)
midvar = invar + 1
midvar[:, 0] = 0
loss = midvar.sum()
loss.backward()
print(invar.grad.data)

The variable midvar is modified inplace.
midvar[:, 0] = 0

But autograd works.