for name, param in graph.named_parameters():
print(name, param.grad)
The above for
loop (which is similar to grad_fn
in some sense) gave this text output where some of the param.grad
are None
.
Please correct me if this debugging method is wrong.