Why do you want to inspect the graph? A new instance is going to be created at every forward.
You can register a hook on any Variable using the register_hook method, or on any module - register_backward_hook.
What are you trying to do, and why doesn’t the FeatureExtractor I shown above work for that?