TorchLean API

NN.Runtime.Autograd.Torch.Core.Ops.Spectral

CUDA tape hooks for Fourier transforms and diagonal scans #

CPU execution declines these hooks before recording anything, allowing the generic differentiable program to run on its ordinary operations. CUDA execution validates reference identities, selects the corresponding backend capsule, and records a TorchLean tape node. Fourier adjoints are composed in Lean; scans call native backward primitives. This keeps provider selection and cross-session checks on the same path as the other eager operations.

@[inline]

Record a LibTorch tape operation only for a CUDA session, preserving reference identity.

Instances For
    def Runtime.Autograd.Torch.Internal.EagerSession.rfft1dNative? {α : Type} [TorchLean.Storage α] (s : EagerSession α) {batch n : ℕ} (x : TensorRef α [batch, n]) :
    IO (Option (TensorRef α [batch, n / 2 + 1, 2]))

    Native real-transform hook; CPU interpreters use the generic matrix reference.

    Instances For

      Native normalized inverse hook with explicit output length.

      Instances For
        def Runtime.Autograd.Torch.Internal.EagerSession.selectiveScanDiagNative? {α : Type} [TorchLean.Storage α] (s : EagerSession α) {seqLen state : ℕ} (a b : TensorRef α [state]) (x : TensorRef α [seqLen, state]) (initial : TensorRef α [state]) :
        IO (Option (TensorRef α [seqLen, state]))

        Native shared-coefficient scan hook with gradients for coefficients, input, and state.

        Instances For
          def Runtime.Autograd.Torch.Internal.EagerSession.selectiveScanDiagVarNative? {α : Type} [TorchLean.Storage α] (s : EagerSession α) {seqLen state : ℕ} (a b x : TensorRef α [seqLen, state]) (initial : TensorRef α [state]) :
          IO (Option (TensorRef α [seqLen, state]))

          Native token-dependent scan hook, including coefficient and continuation-state gradients.

          Instances For