PyTorch Round-Trip Driver #
This module assembles the state-dict round-trip examples.
It does not re-implement model math. Instead it wires together:
- PyTorch exporters (
MLP/Export,CNN/Export,Transformer/Export) - typed PyTorch JSON importers (
MLP/Import,CNN/Import,Transformer/Import) - native tensor operations for the MLP forward pass
- public executable
nnmodules for the CNN and Transformer forward passes
Run via the TorchLean example runner:
lake exe torchlean pytorch_roundtrip --model mlp|cnn|transformer --action export|import
Design goals:
- keep paths/dimensions centralized (no duplicated constants across examples),
- keep the example output deterministic and readable,
- keep this example import-safe (no root-level
mainthat collides with other executables).