TorchLean API

NN.Runtime.Autograd.Torch.Core.Ops.Elementwise

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.

Elementwise operations #

Record elementwise addition a + b. PyTorch: torch.add.

Instances For

    Record elementwise subtraction a - b. PyTorch: torch.sub.

    Instances For

      Record elementwise multiplication a * b. PyTorch: torch.mul.

      Instances For

        Record scaling by a scalar constant. PyTorch: x * c.

        Instances For
          def Runtime.Autograd.Torch.Internal.EagerSession.abs {α : Type} (s : EagerSession α) [Context α] [DecidableRel fun (x1 x2 : α) => x1 > x2] [DecidableEq Spec.Shape] {sh : Spec.Shape} (x : TensorRef α sh) :
          IO (TensorRef α sh)

          Record elementwise absolute value. PyTorch: torch.abs.

          Instances For
            def Runtime.Autograd.Torch.Internal.EagerSession.sqrt {α : Type} (s : EagerSession α) [Context α] [DecidableRel fun (x1 x2 : α) => x1 > x2] [DecidableEq Spec.Shape] {sh : Spec.Shape} (x : TensorRef α sh) :
            IO (TensorRef α sh)

            Record elementwise square root. PyTorch: torch.sqrt.

            Instances For
              def Runtime.Autograd.Torch.Internal.EagerSession.clamp {α : Type} [CudaBridge.TensorConv α] (s : EagerSession α) [Context α] [DecidableRel fun (x1 x2 : α) => x1 > x2] [DecidableEq Spec.Shape] {sh : Spec.Shape} (x : TensorRef α sh) (minVal maxVal : α) :
              IO (TensorRef α sh)

              Record elementwise clamp to [minVal,maxVal]. PyTorch: torch.clamp.

              Instances For
                def Runtime.Autograd.Torch.Internal.EagerSession.max {α : Type} (s : EagerSession α) [Context α] [DecidableRel fun (x1 x2 : α) => x1 > x2] [DecidableEq Spec.Shape] {sh : Spec.Shape} (a b : TensorRef α sh) :
                IO (TensorRef α sh)

                Record elementwise maximum. PyTorch: torch.maximum.

                Instances For
                  def Runtime.Autograd.Torch.Internal.EagerSession.min {α : Type} (s : EagerSession α) [Context α] [DecidableRel fun (x1 x2 : α) => x1 > x2] [DecidableEq Spec.Shape] {sh : Spec.Shape} (a b : TensorRef α sh) :
                  IO (TensorRef α sh)

                  Record elementwise minimum. PyTorch: torch.minimum.

                  Instances For
                    def Runtime.Autograd.Torch.Internal.EagerSession.relu {α : Type} (s : EagerSession α) [Mul α] [Zero α] [Max α] [One α] [LT α] [DecidableRel fun (x1 x2 : α) => x1 > x2] [DecidableEq Spec.Shape] {sh : Spec.Shape} (x : TensorRef α sh) :
                    IO (TensorRef α sh)

                    Record elementwise ReLU. PyTorch: torch.relu / torch.nn.functional.relu.

                    Instances For

                      Record elementwise sigmoid. PyTorch: torch.sigmoid.

                      Instances For

                        Record elementwise tanh. PyTorch: torch.tanh.

                        Instances For

                          Record tanh-approximate GELU as one tape operation.

                          Instances For

                            Record softmax (shape-preserving).

                            PyTorch comparison: torch.softmax(x, dim=...) (dimension convention is chosen by the underlying tape op).

                            Instances For

                              Record stable log-softmax (shape-preserving, last-axis convention).

                              PyTorch comparison: torch.nn.functional.log_softmax(x, dim=-1).

                              Instances For

                                Record elementwise softplus. PyTorch: torch.nn.functional.softplus.

                                Instances For

                                  Record elementwise exponential. PyTorch: torch.exp.

                                  Instances For

                                    Record elementwise log. PyTorch: torch.log.

                                    Instances For

                                      Record elementwise inverse 1/x. PyTorch: torch.reciprocal.

                                      Instances For

                                        Record elementwise log with epsilon guard.

                                        PyTorch comparison: torch.log(torch.clamp(x, min=ε)).

                                        Instances For