TorchLean API

NN.Runtime.Autograd.Torch.Core.Ops.ShapeReduction

Eager Tensor Operations #

PyTorch-style tensor operations backed by the eager CPU/CUDA tapes. These wrappers record runtime nodes, dispatch CUDA kernels when requested, and preserve the typed TensorRef surface.

Shape and reduction operations #

Sum-reduce all elements to a scalar. PyTorch: x.sum().

Instances For

    Flatten a tensor to a 1D vector. PyTorch: torch.flatten.

    Instances For

      Reshape a tensor while preserving total number of elements.

      PyTorch comparison: torch.reshape / view (when valid).

      Instances For

        Transpose a 2D matrix. PyTorch: x.t() / x.transpose(0,1).

        Instances For

          Swap two adjacent axes at a given depth. PyTorch analogue: x.transpose(dim, dim+1).

          Instances For

            Swap the last two axes of a 3D tensor (a,b,c) → (a,c,b). PyTorch: x.transpose(1,2).

            Instances For

              Broadcast a tensor to a larger shape. PyTorch: implicit broadcasting / expand.

              Instances For

                Sum-reduce along axis. PyTorch: torch.sum(x, dim=axis).

                Instances For

                  Mean-reduce along axis. PyTorch: torch.mean(x, dim=axis).

                  Instances For