Repository navigation
v1.0.0
VisualTorch 1.0.0
This is a major release: the API has been substantially reworked since v0.2.5. 1.0.0 marks the render() API as the stable public surface going forward.
Breaking changes
- Replaced three separate functions (
graph_view,layered_view,lenet_view) with a single entry point:visualtorch.render(model, input_shape, style="graph"|"flow"|"lenet", **kwargs). Per-style kwargs are validated via typed dataclasses (GraphStyleOptions/FlowStyleOptions/LenetStyleOptions/CommonOptions) - a typo'd kwarg now raisesTypeErrorinstead of being silently ignored. - Renamed style
"layered"to"flow"everywhere. - Dropped
index_ignore(position-based layer hiding) - no unambiguous meaning under the new topology-based layout.type_ignore(hide by class) still works.
New capabilities
- Multi-input model support: models whose
forward()takes multiple separate input tensors are now supported - pass a tuple of per-tensor shapes asinput_shape, e.g.((1, 3, 224, 224), (1, 10)). - Unified backend: all three styles now share one real topology tracer -
flow/lenetgained genuine branching and skip-connection support they never had before, andgraphdropped its old hardcodedLinear/Conv2d-only restriction. - Skip/residual connections now route as a visible detour line above the diagram in every style, instead of drawing invisible/collinear.
nn.MultiheadAttention(and anyTransformerEncoderLayer/TransformerDecoderLayer) no longer vanishes from the diagram.- RNN/LSTM/GRU output shapes no longer get misread as CNN channel counts.
show_dimensionsupport added across all three styles (including a new toggle forlenet, to avoid label overlap on parallel branches).legendsupport added tograph_view.- Fixed crashes on multi-input shapes (now a clear
ValueError) and on non-Sequential/ModuleListcontainer modules (e.g. timm'sFeatureListNet).
Visual / quality
- Default color palette switched to Okabe-Ito (colorblind-safe) across all three styles.
- Fixed gallery example thumbnails being blindly stretched into a fixed canvas (blur) - now sized proportionally to their native resolution.
- New examples: residual block, multi-branch (Inception-style) merge, multi-input (siamese-style) model, dark background usage - each available in all three styles.
- Refreshed the README and readthedocs homepage banners.
Upgrading
If you depend on the pre-1.0 API, pin to the last compatible release: pip install visualtorch==0.2.5.
Full changelog: v0.2.5...v1.0.0