TorchLean API

NN.GraphSpec.DAG.Lowering

Executable lowering of GraphSpec DAGs #

This module lowers typed DAG terms and multi-result blocks into execution-polymorphic TorchLean programs over backend tensor references.

Typed environment lookup for backend references.

This is the underlying “variable semantics” for Term.lower.

Instances For

    Lowering to TorchLean programs #

    Lower a typed argument list by lowering each component term under the same environment.

    Instances For

      Lower a typed Term Γ τ into the execution monad m, producing a reference to a tensor of shape τ.

      This is the "executable" counterpart of Term.eval: instead of returning a pure TorchLean.Tensor, we emit runtime operations (Runtime.Autograd.Torch.Ops) that allocate tensors and apply primitives.

      Instances For

        Lower a multi-output block for an arbitrary TorchLean execution target.

        Instances For