TorchLean API

NN.API.Json

JSON Parsing #

Conservative JSON helpers shared by artifact loaders and verification tools.

The functions here fail fast with contextual messages. This module stays focused: not a schema library, just the common parsing substrate for TorchLean JSON artifacts.

Parse a JSON value as an object.

Instances For

    Extract a required field from a JSON object.

    Instances For

      Require a JSON string and report context in the error message on mismatch.

      Instances For

        Parse a JSON natural number, accepting either a JSON number or a decimal string.

        Instances For

          Require a JSON array and return its entries.

          Instances For

            Read and parse a JSON file from disk.

            Instances For