TorchLean API

NN.Runtime.Autograd.Engine.Cuda.Ops.Shape

CUDA Tape Operations: Shape and Reduction Nodes #

Reductions / views #

Reduce-sum of all entries, producing a scalar.

Instances For

    Flatten s into a 1D vector of length Shape.size s.

    Instances For
      def Runtime.Autograd.Cuda.Tape.reshape {s₁ s₂ : Spec.Shape} (t : Tape) (xId : ) (_h : s₁.size = s₂.size) :

      Reshape a buffer while preserving number of elements.

      This is a no-copy view operation: it reuses the same contiguous buffer.

      Instances For

        Transpose an m × n CUDA buffer and register the matching transpose rule for backpropagation.

        Instances For

          Swap adjacent axes at a given depth in an N-D buffer.

          If depth is out of range, this is treated as the identity (matches the spec-layer helper).

          Instances For

            Permute a 3D tensor (a,b,c) → (b,c,a).

            Instances For

              Permute a 3D tensor (a,b,c) → (c,a,b).

              Instances For

                Swap the last two axes of a 3D tensor (a,b,c) → (a,c,b).

                Instances For
                  def Runtime.Autograd.Cuda.Tape.broadcastTo {s₁ s₂ : Spec.Shape} (t : Tape) (cb : s₁.CanBroadcastTo s₂) (xId : ) :

                  Broadcast x : s₁ to s₂.

                  Forward: broadcastTo. Backward: sum-reduce broadcasted axes (reduceFromBroadcastTo).

                  Instances For
                    def Runtime.Autograd.Cuda.Tape.reduceSum {s : Spec.Shape} (axis : ) [valid : Spec.Shape.valid_axis_inst axis s] [wf : s.WellFormed] (t : Tape) (xId : ) :

                    Reduce-sum along axis.

                    Instances For
                      def Runtime.Autograd.Cuda.Tape.reduceMean {s : Spec.Shape} (axis : ) [valid : Spec.Shape.valid_axis_inst axis s] [wf : s.WellFormed] (t : Tape) (xId : ) :

                      Reduce-mean along axis.

                      Instances For