TorchLean API

NN.Proofs.Tensor.AxisLinear

Linear axis permutations #

The softmax axis wrapper moves the selected axis to the last position, applies the row kernel, and restores the axes. Each move only changes which input coordinate an output coordinate reads. Its derivative therefore applies the same permutation to the input direction.

The coordinate maps below follow swapAdjacentAxes and permuteByAdjacentSwaps exactly. They also retain the executable convention for an invalid swap depth: that swap leaves the tensor unchanged. No nonempty-axis assumption is needed.

@[reducible, inline]

Source coordinate read by one adjacent-axis swap.

The derivative proofs and the compiled tensor operation use the same coordinate map. This name keeps the coordinate description available in the proof API.

Instances For

    The tensor swap reads exactly the coordinate selected by swapCoordinate.

    Source coordinate read after a sequence of adjacent-axis swaps.

    Instances For

      The coordinate description follows the actual tensor permutation at every rank.

      Axis permutation on finite coordinate functions, bundled as a continuous linear map.

      Instances For

        The continuous linear map computes the library's tensor permutation.

        def Proofs.TensorAxis.castCLM {s t : Spec.Shape} (h : s = t) :
        (s.Coord) →L[] t.Coord

        Transporting coordinate functions through a shape equality is continuous and linear.

        Instances For

          The coordinate transport agrees with the shape transport used by the tensor API.

          Differentiating the actual tensor permutation permutes its input direction.