I don’t think it does 
Error on x.data -= 0.1 * x.grad:

TypeError: sub_ received an invalid combination of arguments - got (Variable), but expected one of:

(float value)
didn’t match because some of the arguments have invalid types: (Variable)
(torch.FloatTensor other)
didn’t match because some of the arguments have invalid types: (Variable)
(float value, torch.FloatTensor other)


CODE:
def helper(x):
return 2 * x[0] + 3 * x[1]**2
x = autograd.Variable(torch.FloatTensor([1, 2]), requires_grad=True)
total = autograd.Variable(torch.FloatTensor([0]))
for i in range(3): # number of epochs
print("iteration: " + str(i))
total += helper(x)
total.backward()
x.data -= 0.1 * x.grad
print(x.grad[0], x.grad[1]) # never gets here