TorchLean API

NN.Verification.Util.Tensor

Tensor helpers for verification artifacts #

Verification tools often sit at the boundary between Lean tensors and external JSON artifacts. This module keeps those conversions in one place instead of reimplementing vector/matrix unpacking inside each checker.

Convert a float array into a length-n vector tensor, returning none on length mismatch.

Instances For

    Convert a row-major flat array into a rows × cols matrix tensor.

    This is the common JSON-artifact shape: external tools often serialize matrices as one flat float array plus schema-level dimensions.

    Instances For

      Convert a rows × cols float matrix payload into a matrix tensor.

      Both the row count and every row length are checked before the tensor is built.

      Instances For

        Convert a vector tensor to a float array.

        Instances For

          Convert lower/upper vector tensors into arrays for artifact checkers.

          Instances For

            Convert a FlatBox Float into lower/upper arrays.

            Instances For

              Convert a shape-indexed vector Box Float into lower/upper arrays.

              Instances For

                Load a length-checked vector tensor from a JSON float array, or raise a schema error.

                Instances For

                  Load a row-major matrix tensor from a JSON float array, or raise a schema error.

                  Instances For