TorchLean API

NN.Examples.Interop.PyTorch.Roundtrip

PyTorch Round-Trip Driver #

This module assembles the state-dict round-trip examples.

It does not re-implement model math. Instead it wires together:

Run via the TorchLean example runner:

scripts/lake.sh exe torchlean pytorch_roundtrip --model mlp --action import

Choose mlp, cnn, or transformer for --model, and export or import for --action.

Design goals:

CLI model/action selection #

Paths and fixed example dimensions #

Small IO helpers #

Export actions #

Import actions #

Load the MLP JSON fixture and evaluate [0.5, 0.8] with native Float tensor operations.

Instances For

    Load the CNN JSON fixture and evaluate the row-major input 1..64 on CPU with scalar Float.

    Instances For

      Load the encoder JSON fixture and evaluate the token [[1.5, 1.5]] on CPU with scalar Float.

      Instances For

        Public entrypoint called from the examples runner #

        Run the selected import or export action; omitted flags select MLP export.

        Instances For