The idea of the linked code is to just run your model as usual to give some function loss.
Then you add the following before and after the backward:
get_dot = register_hooks(loss)
loss.backward()
dot = get_dot()

and then dot contains a dot graph object that you can display in Jupyter or render.
Note that it might get large fast, but for a convnet like you posted it should be OK.
Then the red items are the ones that are problematic. (You could adapt the criterion by changing is_bad_grad.
The other question to ask is, of course, why you’re having exploding gradient issue and what you would do if you knew “where” is happens.
Best regards
Thomas