Hi,
I am quite confuse about your code, and not sure to understand what it is trying to do.
register_backward_hook() allows you to specify a function that will be called just after the backward pass of a nn.Module has been done. It will provide you with the gradients used as parameter for the backward (the derivative of your loss wrt the output of your Module) and the gradients returned by the backward (the derivative of your loss wrt the input of your Module).
network.parameters() will return all the nn.Parameters contained in the nn.Module (and its children). so [x.grad.data for x in network.parameters()] will create a list of all the gradients for each parameter in your model, namely the derivative of the loss wrt the learnable parameters of your Module.
I hope this helps.