I choice the selection scheme “HighestKGradients” and run the code as follows:
net_parser.register_hooks()
target_loss = (criterion(outputs, labels))
target_loss.backward(retain_graph=True)
index_list = net_parser.get_parameters()
But I found that the index_list is none and the function "hook" in function "generated_hook" from the file "HighestKGradients.py" didn't run.


I choice the selection scheme “HighestKGradients” and run the code as follows:
net_parser.register_hooks()target_loss = (criterion(outputs, labels))target_loss.backward(retain_graph=True)index_list = net_parser.get_parameters()But I found that the index_list is none and the function "hook" in function "generated_hook" from the file "HighestKGradients.py" didn't run.