TorchStudio / torchstudio

IDE for PyTorch and its ecosystem
https://torchstudio.ai
MIT License
383 stars 27 forks source link

Build model graph #32

Closed jplasser closed 2 years ago

jplasser commented 2 years ago

Hi, not an issue, but a question: How's the graph built, any references I can use, if I want build such a Graph myself?

Thank you!

divideconcept commented 2 years ago

Hi, the model is parsed and explored with torch.fx, see https://github.com/TorchStudio/torchstudio/blob/main/torchstudio/modelbuild.py The parsed data is then rendered to a svg using graphviz, see https://github.com/TorchStudio/torchstudio/blob/main/torchstudio/graphdraw.py

jplasser commented 2 years ago

Thank you for the details!