Hello my friends. I just find a possible solution to share with you.

If we just use a.backward(), it will perform the simplest form of back propagation.

>>> a = torch.autograd.Variable(torch.Tensor([1]), requires_grad=True)
>>> b = a * 2
>>> b.backward()
>>> a.grad.data
tensor([2.])


However, if we input the parameter of .backward() like -1 (which I find should be a tensor.autograd.Variable ), we can back propagate in a reverse direction.

>>> a = torch.autograd.Variable(torch.Tensor([1]), requires_grad=True)
>>> b = a * 2
>>> z = torch.autograd.Variable(torch.Tensor([-1]), requires_grad=True)
>>> b.backward(z)
>>> a.grad.data
tensor([-2.])


However, if we input just 1 (which is also a tensor.autograd.Variable), it is the same as the default situation.

>>> a = torch.autograd.Variable(torch.Tensor([1]), requires_grad=True)
>>> z = torch.autograd.Variable(torch.Tensor([1]), requires_grad=True)
>>> b = a * 2
>>> b.backward(z)
>>> a.grad.data
tensor([2.])