TorchLean API

NN.API.Neural.Execution

Model Execution #

Forward, prediction, compiled inference, and scalar-module operations for checked sequential models.

structure TorchLean.nn.Compiled (paramShapes : List Shape) (σ τ : Shape) (α : Type) :

A compiled sequential model.

The object returned by model.compile stores the compiled artifact and carries the parameter-shape ABI in its type, so callers can run compiled.forward params x without passing the source model again.

Instances For
    def TorchLean.nn.Compiled.forward {σ τ : Shape} {α : Type} [Context α] [DecidableEq Shape] {paramShapes : List Shape} (compiled : Compiled paramShapes σ τ α) (params : TensorPack α paramShapes) (x : Tensor.T α σ) :
    Tensor.T α τ

    Run a compiled model forward with explicit parameter tensors.

    Instances For

      Compile a sequential model into a reusable callable object.

      Instances For

        Compile a sequential model under an explicit layer mode.

        Instances For