Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Obtaining unit-wise forward computational graph #601

Open
jordiae opened this issue Aug 18, 2020 · 1 comment
Open

Obtaining unit-wise forward computational graph #601

jordiae opened this issue Aug 18, 2020 · 1 comment

Comments

@jordiae
Copy link

jordiae commented Aug 18, 2020

Hi, thanks for your work.

One question: do you know whether it would be feasible to extract the unit-level, forward computational graph of a PyTorch model using some of the internal APIs of tensorboardX? Not necessarily to visualize it (which would be messy), but, for instance, to encode the computational graph of the network into an adjacency matrix for research purposes.

Many thanks in advance.

@lanpa
Copy link
Owner

lanpa commented Sep 11, 2020

Hi there is not such API. But you might want to have a look at: https://github.com/lanpa/tensorboardX/blob/master/tensorboardX/pytorch_graph.py#L293
The link of a node will be iterated there. I think it is possible to identify the and map those nodes by the id() function.
Hope that helps. Note that pytorch_graph.py is legacy (the current tensorboardX relays the graph creation job directly to pytorch), so the current version of pytorch may not work directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants