By populate, I mean allocating the value of the gradients in the tensor. Thanks for clarifying my issue, I now understand that model.forward() only does the forward propagation and no gradient calculation is involved.