I notice that the Variable class has two similar members
._grad. What is the difference between them? In the pytorch a3c implementation pytorch-a3c, there is a piece of code:
def ensure_shared_grads(model, shared_model): for param, shared_param in zip(model.parameters(), shared_model.parameters()): if shared_param.grad is not None: return shared_param._grad = param.grad
Why update member
._grad of the shared_model?