Model Execution #
Forward, prediction, compiled inference, and scalar-module operations for checked sequential models.
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.
- artifact : Runtime.Autograd.Torch.CompiledGraph α (paramShapes ++ [σ]) τ
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
def
Runtime.Autograd.TorchLean.NN.Seq.compile
{σ τ : Spec.Shape}
(model : Seq σ τ)
{α : Type}
[Context α]
[DecidableEq Spec.Shape]
:
IO (TorchLean.nn.Compiled model.paramShapes σ τ α)
Compile a sequential model into a reusable callable object.
Instances For
def
Runtime.Autograd.TorchLean.NN.Seq.compileWithMode
{σ τ : Spec.Shape}
(model : Seq σ τ)
(mode : Mode)
{α : Type}
[Context α]
[DecidableEq Spec.Shape]
:
IO (TorchLean.nn.Compiled model.paramShapes σ τ α)
Compile a sequential model under an explicit layer mode.