Before the first backward call, all grad attributes are set to None. After the first backward you should see some gradient values. Thereafter the gradients will be either zero (after optimizer.zero_grad()) or valid values.