TorchLean API

NN.API.Macros

Small Convenience Macros #

This file contains only general-purpose syntactic sugar:

The sequential macro expands to the composition helpers defined by NN.API.Neural.Builders. The tensor-pack macro expands to constructors under TorchLean.tensorpack.

We avoid layer-specific "proof-eliding" macros here; prefer the named-field APIs in NN.API.Neural for clarity and stable documentation.

Compose Seq models without chaining >>> manually.

Instances For

    Sequential Literals #

    TorchLean sequential models are shape-indexed (Seq σ τ), so we cannot use a plain List of layers like PyTorch does (a List would require every element to have the same type).

    Instead we provide macros that expand to ordinary Seq composition while still letting users write “list-shaped” model definitions.

    Build a TorchLean.TensorPack from comma-separated tensors.

    Instances For