Overview of VisualTorch
mainVisualTorch is a tool designed to visualize PyTorch neural network architectures. It supports generating several visual styles, including:
- flow: Flow-style architectures.
- graph: Graph-style architectures.
- lenet: LeNet-style architectures.
It works with both nn.Sequential and custom PyTorch models by tracing a real forward pass.
Important Limitations:
- Data-dependent control flow: Because it uses tracing, models with branches that depend on tensor values (e.g.,
if x > 0:) will only visualize the path taken by the specific dummy input used during the trace. - Multiple outputs: For layers returning multiple tensors (like
nn.LSTM), the node size is based on the first tensor. However, ifshow_dimension=Trueis used, the labels will display the shapes of all output tensors.