TorchLean API

NN.GraphSpec.Chain.Syntax

Sequential GraphSpec syntax #

This module defines the extensible primitive interface and the shape-indexed Chain language. A chain records its ordered parameter ABI at the type level, and sequential composition concatenates those parameter lists.

structure NN.GraphSpec.Primitive (ps : List Spec.Shape) (σ τ : Spec.Shape) :

A primitive operation in the sequential GraphSpec language.

The pure specFwd interpretation and executable program share the same parameter, input, and output shape indices. The optional layer conversion supports deterministic initialization and conversion to Runtime.Autograd.Model.Layers.Seq.

Instances For

    Chain ps σ τ is a sequential model from shape σ to shape τ whose parameters have shapes ps, in order. Composition concatenates parameter ABIs; use NN.GraphSpec.DAG when explicit sharing or multi-input nodes are required.

    Instances For