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

How can I force a member variable to appear as nested? #98

Open
miccio-dk opened this issue Aug 14, 2023 · 1 comment
Open

How can I force a member variable to appear as nested? #98

miccio-dk opened this issue Aug 14, 2023 · 1 comment

Comments

@miccio-dk
Copy link

Hi :)
As per title, I have a model containing a couple of custom layers, implemented by inheriting from nn.Module.
However, they do not appear as nested blocks in my graph, even tho I have "expand_nested=True".
All the relevant operations performed by the module do appear, but they're just thrown around based on the execution order.
How can I ensure that a given module/element appears in the graph as a nested module?

Thank you so much in advance for the amazing package (and hopefully for the help ;) )

@miccio-dk
Copy link
Author

I figured out that the layer needs to call its forward function to be properly featured in the graph.
I was calling a separate method (with a different name) and that caused it to not be recognized by torchview.

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

1 participant