TorchLean API

NN.Examples.Advanced.IRAxisOps

IR axis operations #

IR axis-ops smoke tutorial.

This file is a small “regression guard” for three ops where TorchLean’s IR uses an explicit axis:

Why this tutorial exists:

Run:

lake exe torchlean ir_axis_ops --dtype float --backend eager

Test Shapes #

We keep shapes small so this tutorial runs instantly, but still exercises the “axis is not last / not 0” code paths.

@[reducible, inline]
Instances For
    @[reducible, inline]
    Instances For
      @[reducible, inline]
      Instances For

        Small IR Graphs #

        Runner Helpers #

        def NN.Examples.Advanced.IRAxisOps.runOne {α : Type} [API.Semantics.Scalar α] [DecidableEq Spec.Shape] [ToString α] [API.Runtime.Scalar α] (tag : String) (g : IR.Graph) (payload : IR.Payload α) (inputShape : Spec.Shape) (x : Spec.Tensor α inputShape) (outputId : Fin g.nodes.size) (runCompiled : Bool := true) :
        Instances For