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. Flat payloads are checked against the requested tensor shape; nested matrix payloads also check each row. Once loaded, the checkers work with tensors rather than serialized arrays.

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

          Read a row-major artifact into the requested tensor shape; reject a length mismatch.

          Instances For
            def NN.Verification.Util.Tensor.ofRows? {α : Type} [TorchLean.Storage α] (rows cols : ℕ) (xs : Array (Array α)) :

            Read a nested row-major artifact into a matrix tensor.

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

            Instances For

              Read a JSON float array into the requested shape, or raise a schema error.

              Instances For