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 Spec.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

        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
          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.HasNonemptyAxis 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.HasNonemptyAxis axis s] [_wf : s.WellFormed] (t : Tape) (xId : ) :

              Reduce-mean along axis.

              Instances For