TorchLean API

NN.Examples.Advanced.IRAxisOps

IR axis operations #

IR axis-ops runtime tutorial.

This example 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

Command-line help for the IR axis-ops tutorial.

Instances For

    Test Shapes #

    We keep shapes compact while still exercising 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} [TorchLean.Runtime.SemanticScalar α] [DecidableEq Shape] [ToString α] [TorchLean.Runtime.Scalar α] (tag : String) (g : IR.Graph) (payload : IR.Payload α) (inputShape : Shape) (x : Spec.Tensor α inputShape) (outputId : Fin g.nodes.size) (runCompiled : Bool := true) :
          Instances For

            Runtime-selected entrypoint body for the axis-ops tutorial.

            Instances For