Skip to content

v1.0.0

Choose a tag to compare

@willyfh willyfh released this 02 Jul 23:45
· 117 commits to main since this release
89d0474

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 raises TypeError instead 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 as input_shape, e.g. ((1, 3, 224, 224), (1, 10)).
  • Unified backend: all three styles now share one real topology tracer - flow/lenet gained genuine branching and skip-connection support they never had before, and graph dropped its old hardcoded Linear/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 any TransformerEncoderLayer/TransformerDecoderLayer) no longer vanishes from the diagram.
  • RNN/LSTM/GRU output shapes no longer get misread as CNN channel counts.
  • show_dimension support added across all three styles (including a new toggle for lenet, to avoid label overlap on parallel branches).
  • legend support added to graph_view.
  • Fixed crashes on multi-input shapes (now a clear ValueError) and on non-Sequential/ModuleList container modules (e.g. timm's FeatureListNet).

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