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.

Pointwise ordering of equally shaped bounds. NaN comparisons fail.

Instances For

    Check ordered leaf bounds contained in an equally shaped root box.

    Instances For

      A strict lower-bound witness refutes its corresponding threshold.

      Instances For
        def NN.Verification.Util.Tensor.refutesThresholdAt {n : } (lowerBound threshold : TorchLean.Tensor Float [n]) (witnessIdx : ) :

        Check the supplied coordinate; out-of-range witnesses and NaN comparisons fail.

        Instances For

          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

                  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