TorchLean API

NN.Runtime.Autograd.Engine.LibTorch.Convert

Flatten (TorchLean.Tensor → FloatArray) #

Row-major order with outermost axis first and innermost axis last.

Flatten a TorchLean.Tensor Float s into a row-major FloatArray (CUDA-compatible).

Instances For

    Flatten a TorchLean.Tensor Bool s mask to FloatArray as 0.0/1.0 values in row-major order.

    Instances For

      Unflatten (FloatArray → TorchLean.Tensor) #

      These functions assume row-major order. The public operations check the expected length and return none on mismatch. Runtime code that already owns the buffer-size invariant calls the internal workers directly.

      Read a tensor out of a starting at offset, trusting the caller for the bounds. The checked entry point is unflattenFloat?; this one exists so a batched download can slice one array.

      Instances For

        Unflatten a row-major FloatArray into a TorchLean.Tensor Float s when a.size matches.

        Instances For