spfrommer / torchexplorer

Interactively inspect module inputs, outputs, parameters, and gradients.
https://spfrommer.github.io/torchexplorer/
Apache License 2.0
235 stars 14 forks source link

Manually invoke update of `data.json`. #55

Open pascal-mueller opened 1 month ago

pascal-mueller commented 1 month ago

Hello,

I would like to look at the computational graph at different stages of it. For specific reason I have to use autograd.grad which seems doesn't update data.json at all. It seems that torchexplorer uses handle_step() to update the data.json which in turn is called in these two hooks:

    module.register_forward_pre_hook(pre_forward_hook)
    module.register_full_backward_hook(post_backward_hook)

I think those two hooks are never called when you use autograd.grad. I'd like to be able to check out the computational graph at any time, so I was wondering if there's a way to manually update data.json?

spfrommer commented 4 weeks ago

I'm not immediately sure how something like this should be handled, and unfortunately I'm too swamped at the moment to look into it myself. If you figure something out definitely feel free to update.