NN.Runtime.PyTorch.Export #
Reusable PyTorch export/adaptation surface.
Use this umbrella when you want the runtime bridge, not the example models:
Export.Coreprovides shared Python string-generation utilities.Export.IRPyTorchlowers a TorchLeanNN.IR.Graphplus parameters into readable PyTorchnn.Modulesource.Export.ONNXemits a conservative ONNX-to-torchlean.ir.v1adapter for static graph fragments, including expanded graph lowerings for common Conv/Gemm/BatchNorm patterns.Export.StateDictemits the general checkpoint-to-JSON adapter for PyTorchstate_dictartifacts.Export.TorchExportemits the Python graph-capture adapter for PyTorchnn.Module→ TorchLean IR JSON.
For ONNX workflows, the architecture is the same: the Python-side adapter reads ONNX and emits
torchlean.ir.v1; Lean then accepts or rejects the result through
NN.Runtime.PyTorch.Import.TorchExport. That keeps graph import tied to the same checked IR
contracts used by torch.export/FX capture. The adapter validates graph structure and shapes;
runtime execution of imported parameterized nodes still needs the matching payload store.
Example-specific MLP/CNN/Transformer code lives beside its reference artifacts under
NN.Examples.Interop.PyTorch.{MLP,CNN,Transformer}.*.