{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.runlocal.ai/schemas/v1/graph.json",
  "title": "Authoritative graph",
  "description": "A runlocal.graph/3.0 document: the authoritative JSON graph of one function body. It chooses one operator system, then states every graph input, output, initializer, node, attribute, subgraph, and local function. Each node names one request operator. Tensor records state types and data size and never include private weight values. Validation does not execute inline Torch source.",
  "type": "object",
  "required": [
    "kind",
    "protocol_version",
    "operator_system",
    "producer",
    "graph",
    "functions"
  ],
  "properties": {
    "kind": {
      "description": "The document kind.",
      "type": "string",
      "const": "runlocal.graph"
    },
    "protocol_version": {
      "description": "The graph version this document conforms to.",
      "type": "string",
      "const": "3.0"
    },
    "operator_system": {
      "$ref": "#/$defs/OperatorSystem"
    },
    "producer": {
      "$ref": "#/$defs/Tool"
    },
    "graph": {
      "$ref": "#/$defs/Graph"
    },
    "functions": {
      "description": "The model's local functions in graph order; empty when it has none.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/LocalFunction"
      }
    }
  },
  "additionalProperties": false,
  "$defs": {
    "Attribute": {
      "title": "Attribute",
      "description": "One node attribute, tagged by its ONNX attribute type.",
      "oneOf": [
        {
          "$ref": "#/$defs/RefAttribute"
        },
        {
          "$ref": "#/$defs/IntAttribute"
        },
        {
          "$ref": "#/$defs/IntsAttribute"
        },
        {
          "$ref": "#/$defs/FloatAttribute"
        },
        {
          "$ref": "#/$defs/FloatsAttribute"
        },
        {
          "$ref": "#/$defs/StringAttribute"
        },
        {
          "$ref": "#/$defs/StringsAttribute"
        },
        {
          "$ref": "#/$defs/TensorAttribute"
        },
        {
          "$ref": "#/$defs/TensorsAttribute"
        },
        {
          "$ref": "#/$defs/Sparse_tensorAttribute"
        },
        {
          "$ref": "#/$defs/Sparse_tensorsAttribute"
        },
        {
          "$ref": "#/$defs/GraphAttribute"
        },
        {
          "$ref": "#/$defs/GraphsAttribute"
        },
        {
          "$ref": "#/$defs/TypeAttribute"
        },
        {
          "$ref": "#/$defs/TypesAttribute"
        }
      ],
      "discriminator": {
        "mapping": {
          "ref": "#/$defs/RefAttribute",
          "int": "#/$defs/IntAttribute",
          "ints": "#/$defs/IntsAttribute",
          "float": "#/$defs/FloatAttribute",
          "floats": "#/$defs/FloatsAttribute",
          "string": "#/$defs/StringAttribute",
          "strings": "#/$defs/StringsAttribute",
          "tensor": "#/$defs/TensorAttribute",
          "tensors": "#/$defs/TensorsAttribute",
          "sparse_tensor": "#/$defs/Sparse_tensorAttribute",
          "sparse_tensors": "#/$defs/Sparse_tensorsAttribute",
          "graph": "#/$defs/GraphAttribute",
          "graphs": "#/$defs/GraphsAttribute",
          "type": "#/$defs/TypeAttribute",
          "types": "#/$defs/TypesAttribute"
        },
        "propertyName": "kind"
      }
    },
    "ElementType": {
      "title": "ElementType",
      "description": "An ONNX tensor element type by its ONNX name; float is 32-bit.",
      "type": "string",
      "enum": [
        "float",
        "double",
        "float16",
        "bfloat16",
        "float8e4m3fn",
        "float8e4m3fnuz",
        "float8e5m2",
        "float8e5m2fnuz",
        "float8e8m0",
        "float4e2m1",
        "int2",
        "int4",
        "int8",
        "int16",
        "int32",
        "int64",
        "uint4",
        "uint2",
        "uint8",
        "uint16",
        "uint32",
        "uint64",
        "bool",
        "string",
        "complex64",
        "complex128"
      ]
    },
    "Float": {
      "title": "Float",
      "description": "An ONNX float or double: a JSON number when finite, otherwise NaN, Infinity, or -Infinity as a string.",
      "anyOf": [
        {
          "description": "A finite number.",
          "type": "number"
        },
        {
          "description": "An exceptional value, which JSON cannot write as a number.",
          "type": "string",
          "enum": [
            "NaN",
            "Infinity",
            "-Infinity"
          ]
        }
      ]
    },
    "FloatAttribute": {
      "title": "FloatAttribute",
      "description": "A FLOAT attribute.",
      "type": "object",
      "required": [
        "kind",
        "value"
      ],
      "properties": {
        "kind": {
          "description": "Always \"float\". Selects this alternative.",
          "type": "string",
          "const": "float"
        },
        "value": {
          "$ref": "#/$defs/Float"
        }
      },
      "additionalProperties": false
    },
    "FloatsAttribute": {
      "title": "FloatsAttribute",
      "description": "A FLOATS attribute.",
      "type": "object",
      "required": [
        "kind",
        "value"
      ],
      "properties": {
        "kind": {
          "description": "Always \"floats\". Selects this alternative.",
          "type": "string",
          "const": "floats"
        },
        "value": {
          "description": "The numbers.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Float"
          }
        }
      },
      "additionalProperties": false
    },
    "Graph": {
      "title": "Graph",
      "description": "A graph: its boundary values, its initializers, and its nodes. The main graph, and the body of a control-flow attribute.",
      "type": "object",
      "required": [
        "name",
        "inputs",
        "outputs",
        "initializers",
        "values",
        "nodes"
      ],
      "properties": {
        "name": {
          "description": "The graph's name, or empty.",
          "type": "string"
        },
        "inputs": {
          "description": "The graph inputs in order.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Value"
          }
        },
        "outputs": {
          "description": "The graph outputs in order.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Value"
          }
        },
        "initializers": {
          "description": "The model constants in graph order. A replaceable weight does not appear here.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Tensor"
          }
        },
        "sparse_initializers": {
          "description": "Sparse initializers. Omitted means none. The values tensor names the initializer.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/SparseTensor"
          }
        },
        "values": {
          "description": "The stated types for values between nodes, in order. List each intermediate value with its type. The list can be empty, but then the server cannot check each node, and node validation stays incomplete.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Value"
          }
        },
        "nodes": {
          "description": "The nodes in topological order.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Node"
          }
        }
      },
      "additionalProperties": false
    },
    "GraphAttribute": {
      "title": "GraphAttribute",
      "description": "A GRAPH attribute: the body of an If, Loop, or Scan branch. Its nodes may read values of the enclosing graph.",
      "type": "object",
      "required": [
        "kind",
        "value"
      ],
      "properties": {
        "kind": {
          "description": "Always \"graph\". Selects this alternative.",
          "type": "string",
          "const": "graph"
        },
        "value": {
          "$ref": "#/$defs/Graph"
        }
      },
      "additionalProperties": false
    },
    "GraphsAttribute": {
      "title": "GraphsAttribute",
      "description": "A GRAPHS attribute.",
      "type": "object",
      "required": [
        "kind",
        "value"
      ],
      "properties": {
        "kind": {
          "description": "Always \"graphs\". Selects this alternative.",
          "type": "string",
          "const": "graphs"
        },
        "value": {
          "description": "The graphs.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Graph"
          }
        }
      },
      "additionalProperties": false
    },
    "Int64": {
      "title": "Int64",
      "description": "An ONNX int64: a JSON integer when it is exactly representable, otherwise its decimal digits as a string.",
      "anyOf": [
        {
          "description": "A JSON integer within the exactly representable range.",
          "type": "integer",
          "minimum": -9007199254740991,
          "maximum": 9007199254740991
        },
        {
          "description": "A decimal string, for an integer beyond 2^53 in magnitude.",
          "type": "string",
          "pattern": "^(0|-?[1-9][0-9]*)$"
        }
      ]
    },
    "IntAttribute": {
      "title": "IntAttribute",
      "description": "An INT attribute.",
      "type": "object",
      "required": [
        "kind",
        "value"
      ],
      "properties": {
        "kind": {
          "description": "Always \"int\". Selects this alternative.",
          "type": "string",
          "const": "int"
        },
        "value": {
          "$ref": "#/$defs/Int64"
        }
      },
      "additionalProperties": false
    },
    "IntsAttribute": {
      "title": "IntsAttribute",
      "description": "An INTS attribute.",
      "type": "object",
      "required": [
        "kind",
        "value"
      ],
      "properties": {
        "kind": {
          "description": "Always \"ints\". Selects this alternative.",
          "type": "string",
          "const": "ints"
        },
        "value": {
          "description": "The integers.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Int64"
          }
        }
      },
      "additionalProperties": false
    },
    "LocalFunction": {
      "title": "LocalFunction",
      "description": "A model-local ONNX function. Its identity matches one ONNX operator entry. Torch graphs do not use this list.",
      "type": "object",
      "required": [
        "name",
        "domain",
        "overload",
        "inputs",
        "outputs",
        "attributes",
        "opsets",
        "nodes"
      ],
      "properties": {
        "name": {
          "$ref": "#/$defs/Name"
        },
        "domain": {
          "description": "The function's domain.",
          "type": "string"
        },
        "overload": {
          "description": "The overload, or empty.",
          "type": "string"
        },
        "inputs": {
          "description": "Formal input names.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Name"
          }
        },
        "outputs": {
          "description": "Formal output names.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Name"
          }
        },
        "attributes": {
          "description": "Required attribute names. These have no default.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Name"
          }
        },
        "attribute_defaults": {
          "description": "Optional attributes and their default values. Omitted means none. A default must be a value, not a reference.",
          "type": "object",
          "propertyNames": {
            "$ref": "#/$defs/Name"
          },
          "additionalProperties": {
            "$ref": "#/$defs/Attribute"
          }
        },
        "opsets": {
          "description": "The opsets the body imports.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Opset"
          }
        },
        "nodes": {
          "description": "The body's nodes in order.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Node"
          }
        }
      },
      "additionalProperties": false
    },
    "Name": {
      "title": "Name",
      "description": "A name of this graph document: a graph value, node, operator, or attribute name. Any non-empty string is valid. Keep the names of the source model when it has them, so that a result maps back to the source.",
      "type": "string",
      "examples": [
        "X",
        "/encoder/layer.0/Add_output_0"
      ],
      "minLength": 1,
      "x-runlocal-form": "the name exactly as the graph spells it"
    },
    "Nat": {
      "title": "Nat",
      "description": "A whole number from 0 to 2^53 - 1.",
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "Node": {
      "title": "Node",
      "description": "One node: which request operator it applies and to which values. An ONNX node states attributes and binds inputs by position. A Torch node has no attributes. It states arguments by parameter name, and module_state by parameter or buffer name. Nodes are listed in topological order.",
      "type": "object",
      "required": [
        "name",
        "operator",
        "inputs",
        "outputs",
        "attributes"
      ],
      "properties": {
        "name": {
          "description": "The node's name, or empty. An unnamed node is referred to by its graph path.",
          "type": "string"
        },
        "operator": {
          "description": "The request operator entry this node applies.",
          "$ref": "#/$defs/Name"
        },
        "inputs": {
          "description": "Input value names in the operator's order.",
          "type": "array",
          "items": {
            "description": "A value name, or empty for an absent optional input.",
            "type": "string"
          }
        },
        "outputs": {
          "description": "Output value names in the operator's order.",
          "type": "array",
          "items": {
            "description": "A value name, or empty for an unused optional output.",
            "type": "string"
          }
        },
        "attributes": {
          "description": "The node's attributes by name; empty when it has none. Copy each attribute that the source node states. An omitted attribute has the default of the operator definition, so omit one only when the source omits it too.",
          "type": "object",
          "propertyNames": {
            "$ref": "#/$defs/Name"
          },
          "additionalProperties": {
            "$ref": "#/$defs/Attribute"
          }
        },
        "arguments": {
          "description": "Torch only: the arguments of this call by parameter name. inputs lists each tensor that the arguments and module_state name, one time each, in any order.",
          "type": "object",
          "propertyNames": {
            "description": "A Python parameter name.",
            "type": "string",
            "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
          },
          "additionalProperties": {
            "$ref": "#/$defs/TorchArgument"
          }
        },
        "module_state": {
          "description": "Torch module only: the tensor of each module parameter and buffer.",
          "type": "object",
          "propertyNames": {
            "description": "A qualified parameter or buffer name of the module.",
            "type": "string",
            "maxLength": 512,
            "minLength": 1
          },
          "additionalProperties": {
            "description": "A value name that a private weight port binds.",
            "type": "string",
            "minLength": 1
          }
        }
      },
      "additionalProperties": false
    },
    "OnnxOperatorSystem": {
      "title": "OnnxOperatorSystem",
      "description": "The ONNX operator system and the opsets this graph imports, for a model that the customer already has as ONNX.",
      "type": "object",
      "required": [
        "kind",
        "opsets"
      ],
      "properties": {
        "kind": {
          "description": "Always \"onnx\". Selects this alternative.",
          "type": "string",
          "const": "onnx"
        },
        "opsets": {
          "description": "The model's opset_import entries.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Opset"
          }
        }
      },
      "additionalProperties": false
    },
    "OperatorSystem": {
      "title": "OperatorSystem",
      "description": "The graph's single operator system. A graph cannot mix Torch and ONNX operators. Torch is the default for a model that is written in PyTorch: the graph states the Torch operators that the program calls, in a pinned environment, so nothing is converted. ONNX is for a model that the customer already has as ONNX. To export a PyTorch model to ONNX is a conversion and a trace, which can change the computation, so do not make an export only for a request.",
      "oneOf": [
        {
          "$ref": "#/$defs/TorchOperatorSystem"
        },
        {
          "$ref": "#/$defs/OnnxOperatorSystem"
        }
      ],
      "discriminator": {
        "mapping": {
          "torch": "#/$defs/TorchOperatorSystem",
          "onnx": "#/$defs/OnnxOperatorSystem"
        },
        "propertyName": "kind"
      }
    },
    "Opset": {
      "title": "Opset",
      "description": "One opset_import entry.",
      "type": "object",
      "required": [
        "domain",
        "version"
      ],
      "properties": {
        "domain": {
          "description": "The operator domain; empty for the standard operators.",
          "type": "string"
        },
        "version": {
          "description": "The imported opset version.",
          "$ref": "#/$defs/Nat"
        }
      },
      "additionalProperties": false
    },
    "RefAttribute": {
      "title": "RefAttribute",
      "description": "An attribute supplied by the enclosing local function. The name is its ONNX ref_attr_name.",
      "type": "object",
      "required": [
        "kind",
        "name",
        "type"
      ],
      "properties": {
        "kind": {
          "description": "Always \"ref\". Selects this alternative.",
          "type": "string",
          "const": "ref"
        },
        "name": {
          "$ref": "#/$defs/Name"
        },
        "type": {
          "description": "The referenced attribute type.",
          "type": "string",
          "enum": [
            "int",
            "ints",
            "float",
            "floats",
            "string",
            "strings",
            "tensor",
            "tensors",
            "sparse_tensor",
            "sparse_tensors",
            "graph",
            "graphs",
            "type",
            "types"
          ]
        }
      },
      "additionalProperties": false
    },
    "SparseTensor": {
      "title": "SparseTensor",
      "description": "A sparse tensor (an ONNX SparseTensorProto): its stored values, their indices, and the dense shape. Its two tensors count in the census like any other.",
      "type": "object",
      "required": [
        "values",
        "indices",
        "shape"
      ],
      "properties": {
        "values": {
          "description": "The non-zero values, a rank-1 tensor with one element per stored entry.",
          "$ref": "#/$defs/Tensor"
        },
        "indices": {
          "description": "The int64 indices of those values: rank 1 with one linear index per entry, or rank 2 with one coordinate row per entry.",
          "$ref": "#/$defs/Tensor"
        },
        "shape": {
          "description": "The dense shape.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Nat"
          }
        }
      },
      "additionalProperties": false
    },
    "Sparse_tensorAttribute": {
      "title": "Sparse_tensorAttribute",
      "description": "A SPARSE_TENSOR attribute.",
      "type": "object",
      "required": [
        "kind",
        "value"
      ],
      "properties": {
        "kind": {
          "description": "Always \"sparse_tensor\". Selects this alternative.",
          "type": "string",
          "const": "sparse_tensor"
        },
        "value": {
          "$ref": "#/$defs/SparseTensor"
        }
      },
      "additionalProperties": false
    },
    "Sparse_tensorsAttribute": {
      "title": "Sparse_tensorsAttribute",
      "description": "A SPARSE_TENSORS attribute.",
      "type": "object",
      "required": [
        "kind",
        "value"
      ],
      "properties": {
        "kind": {
          "description": "Always \"sparse_tensors\". Selects this alternative.",
          "type": "string",
          "const": "sparse_tensors"
        },
        "value": {
          "description": "The sparse tensors.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/SparseTensor"
          }
        }
      },
      "additionalProperties": false
    },
    "StringAttribute": {
      "title": "StringAttribute",
      "description": "A STRING attribute.",
      "type": "object",
      "required": [
        "kind",
        "value"
      ],
      "properties": {
        "kind": {
          "description": "Always \"string\". Selects this alternative.",
          "type": "string",
          "const": "string"
        },
        "value": {
          "description": "The text, UTF-8 decoded.",
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "StringsAttribute": {
      "title": "StringsAttribute",
      "description": "A STRINGS attribute.",
      "type": "object",
      "required": [
        "kind",
        "value"
      ],
      "properties": {
        "kind": {
          "description": "Always \"strings\". Selects this alternative.",
          "type": "string",
          "const": "strings"
        },
        "value": {
          "description": "The texts.",
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "additionalProperties": false
    },
    "Tensor": {
      "title": "Tensor",
      "description": "A tensor in the graph: an initializer, a Constant node's value, or a tensor attribute. It has exactly one complete data source: inline values or an exact external slice. Replaceable weights are graph inputs, not tensors in this list.",
      "type": "object",
      "required": [
        "name",
        "type",
        "bytes",
        "external",
        "values"
      ],
      "properties": {
        "name": {
          "description": "The tensor's name, or empty for an unnamed attribute tensor.",
          "type": "string"
        },
        "type": {
          "description": "The tensor's element type and shape. Every dimension is a number.",
          "$ref": "#/$defs/TensorType"
        },
        "bytes": {
          "description": "The byte count of the tensor data, also when values are written inline: the element count times the bits of the element type, divided by 8 and rounded up. For example int64[2] has 16, and int4[3] has 2. A string tensor has the sum of the UTF-8 lengths of its values. A tensor with no element has 0.",
          "$ref": "#/$defs/Nat"
        },
        "external": {
          "description": "The exact external-data slice, or null when values are inline. The location is looked up in the body's external_data list, never resolved as a path.",
          "anyOf": [
            {
              "description": "An exact slice of a bundled external-data file.",
              "type": "object",
              "required": [
                "location",
                "offset",
                "length",
                "encoding"
              ],
              "properties": {
                "location": {
                  "description": "An external-data location key.",
                  "type": "string",
                  "minLength": 1
                },
                "offset": {
                  "$ref": "#/$defs/Nat"
                },
                "length": {
                  "$ref": "#/$defs/Nat"
                },
                "encoding": {
                  "description": "Numeric elements use little-endian byte order. Packed elements put the first value in the least significant bits.",
                  "type": "string",
                  "const": "little_endian"
                }
              },
              "additionalProperties": false
            },
            {
              "type": "null"
            }
          ]
        },
        "values": {
          "description": "The exact logical elements in row-major order, or null when external names an exact bundled slice. Use inline values for small structural constants such as shapes, axes, and scalars. The count equals the product of the shape.",
          "anyOf": [
            {
              "description": "The exact logical elements in row-major order.",
              "type": "array",
              "items": {
                "description": "One element, interpreted by the tensor's element type.",
                "anyOf": [
                  {
                    "type": "boolean"
                  },
                  {
                    "$ref": "#/$defs/Float"
                  },
                  {
                    "$ref": "#/$defs/Int64"
                  },
                  {
                    "description": "One complex element.",
                    "type": "object",
                    "required": [
                      "real",
                      "imaginary"
                    ],
                    "properties": {
                      "real": {
                        "$ref": "#/$defs/Float"
                      },
                      "imaginary": {
                        "$ref": "#/$defs/Float"
                      }
                    },
                    "additionalProperties": false
                  }
                ]
              }
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": false
    },
    "TensorAttribute": {
      "title": "TensorAttribute",
      "description": "A TENSOR attribute, such as the value of a Constant node.",
      "type": "object",
      "required": [
        "kind",
        "value"
      ],
      "properties": {
        "kind": {
          "description": "Always \"tensor\". Selects this alternative.",
          "type": "string",
          "const": "tensor"
        },
        "value": {
          "$ref": "#/$defs/Tensor"
        }
      },
      "additionalProperties": false
    },
    "TensorType": {
      "title": "TensorType",
      "description": "A tensor type in the ONNX text format used by the request: an element type, then the shape in square brackets, where a dimension is a number, a dim_param symbol, or ? for a dimension with neither.",
      "type": "string",
      "pattern": "^(float|double|float16|bfloat16|float8e4m3fn|float8e4m3fnuz|float8e5m2|float8e5m2fnuz|float8e8m0|float4e2m1|int2|int4|int8|int16|int32|int64|uint4|uint2|uint8|uint16|uint32|uint64|bool|string|complex64|complex128)\\[((\\?|0|[1-9][0-9]*|[A-Za-z_][A-Za-z0-9_]*)(,(\\?|0|[1-9][0-9]*|[A-Za-z_][A-Za-z0-9_]*))*)?\\]$",
      "examples": [
        "float[N,512]",
        "int64[]"
      ],
      "x-runlocal-form": "the ONNX text format, an element type then the shape in square brackets with no spaces"
    },
    "TensorsAttribute": {
      "title": "TensorsAttribute",
      "description": "A TENSORS attribute.",
      "type": "object",
      "required": [
        "kind",
        "value"
      ],
      "properties": {
        "kind": {
          "description": "Always \"tensors\". Selects this alternative.",
          "type": "string",
          "const": "tensors"
        },
        "value": {
          "description": "The tensors.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/Tensor"
          }
        }
      },
      "additionalProperties": false
    },
    "Tool": {
      "title": "Tool",
      "description": "The tool that wrote this graph document, by name and version.",
      "type": "object",
      "required": [
        "name",
        "version"
      ],
      "properties": {
        "name": {
          "description": "The name of the tool that wrote this JSON graph document. It is not the exporter of a native model, such as the producer of an ONNX file. When an agent wrote the document, write the name of the agent.",
          "type": "string"
        },
        "version": {
          "description": "The version of that tool. Write 1 when it has none.",
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "TorchArgument": {
      "title": "TorchArgument",
      "description": "One argument of a Torch call. A parameter that the node does not name keeps its Python default. There is no positional guessing.",
      "anyOf": [
        {
          "description": "One tensor.",
          "type": "object",
          "required": [
            "tensor"
          ],
          "properties": {
            "tensor": {
              "description": "A value name.",
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        },
        {
          "description": "A tensor list or tuple, such as the first argument of torch.cat.",
          "type": "object",
          "required": [
            "tensors"
          ],
          "properties": {
            "tensors": {
              "description": "Value names in list order.",
              "type": "array",
              "items": {
                "description": "A value name.",
                "type": "string",
                "minLength": 1
              }
            }
          },
          "additionalProperties": false
        },
        {
          "description": "A Python literal: None, a bool, an int, a float, a str, or a list of these. A JSON array states a Python tuple or list. A JSON object states a dict, which the catalog of a public callable never takes, so a dict argument needs inline source.",
          "type": "object",
          "required": [
            "value"
          ],
          "properties": {
            "value": {
              "description": "A literal JSON value. It is never evaluated."
            }
          },
          "additionalProperties": false
        },
        {
          "description": "A torch.dtype, such as torch.bfloat16.",
          "type": "object",
          "required": [
            "dtype"
          ],
          "properties": {
            "dtype": {
              "description": "A Torch dtype name without the torch prefix. The pinned release states which names exist.",
              "type": "string",
              "pattern": "^[a-z][a-z0-9_]*$",
              "maxLength": 64
            }
          },
          "additionalProperties": false
        },
        {
          "description": "A size whose extents can name dimensions of the function, such as [B, S, -1, 256].",
          "type": "object",
          "required": [
            "size"
          ],
          "properties": {
            "size": {
              "description": "One extent or a list of extents.",
              "anyOf": [
                {
                  "description": "One extent: an integer, or a dimension name of the function.",
                  "anyOf": [
                    {
                      "description": "An exact extent, or -1 where the callable infers the extent.",
                      "type": "integer"
                    },
                    {
                      "description": "A dimension name of the function, such as B or S.",
                      "type": "string",
                      "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
                    }
                  ]
                },
                {
                  "description": "Extents in order.",
                  "type": "array",
                  "items": {
                    "description": "One extent: an integer, or a dimension name of the function.",
                    "anyOf": [
                      {
                        "description": "An exact extent, or -1 where the callable infers the extent.",
                        "type": "integer"
                      },
                      {
                        "description": "A dimension name of the function, such as B or S.",
                        "type": "string",
                        "pattern": "^[A-Za-z_][A-Za-z0-9_]*$"
                      }
                    ]
                  }
                }
              ]
            }
          },
          "additionalProperties": false
        }
      ]
    },
    "TorchOperatorSystem": {
      "title": "TorchOperatorSystem",
      "description": "The Torch operator system and its pinned request environment. It is the default for a PyTorch model.",
      "type": "object",
      "required": [
        "kind",
        "environment"
      ],
      "properties": {
        "kind": {
          "description": "Always \"torch\". Selects this alternative.",
          "type": "string",
          "const": "torch"
        },
        "environment": {
          "description": "The request environment used by every operator in this graph.",
          "$ref": "#/$defs/Name"
        }
      },
      "additionalProperties": false
    },
    "TypeAttribute": {
      "title": "TypeAttribute",
      "description": "A TYPE_PROTO attribute.",
      "type": "object",
      "required": [
        "kind",
        "value"
      ],
      "properties": {
        "kind": {
          "description": "Always \"type\". Selects this alternative.",
          "type": "string",
          "const": "type"
        },
        "value": {
          "$ref": "#/$defs/ValueType"
        }
      },
      "additionalProperties": false
    },
    "TypesAttribute": {
      "title": "TypesAttribute",
      "description": "A TYPE_PROTOS attribute.",
      "type": "object",
      "required": [
        "kind",
        "value"
      ],
      "properties": {
        "kind": {
          "description": "Always \"types\". Selects this alternative.",
          "type": "string",
          "const": "types"
        },
        "value": {
          "description": "The types.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/ValueType"
          }
        }
      },
      "additionalProperties": false
    },
    "Value": {
      "title": "Value",
      "description": "A named value at a graph boundary or between nodes: a graph input, a graph output, or a value_info entry.",
      "type": "object",
      "required": [
        "name",
        "type"
      ],
      "properties": {
        "name": {
          "$ref": "#/$defs/Name"
        },
        "type": {
          "$ref": "#/$defs/ValueType"
        }
      },
      "additionalProperties": false
    },
    "ValueType": {
      "title": "ValueType",
      "description": "The type of a graph value. A tensor with a known rank uses the same text as the request interface. A value with no known type is written as {\"proto\": \"?\"}.",
      "anyOf": [
        {
          "$ref": "#/$defs/TensorType"
        },
        {
          "description": "A tensor whose element type is known and whose rank is not.",
          "type": "object",
          "required": [
            "elem"
          ],
          "properties": {
            "elem": {
              "$ref": "#/$defs/ElementType"
            }
          },
          "additionalProperties": false
        },
        {
          "description": "A type that is not a tensor: a sequence, map, optional, or sparse tensor, written in the ONNX text form.",
          "type": "object",
          "required": [
            "proto"
          ],
          "properties": {
            "proto": {
              "description": "The type in the ONNX text form, for example seq(tensor(float)).",
              "type": "string",
              "minLength": 1
            }
          },
          "additionalProperties": false
        }
      ]
    }
  },
  "x-runlocal-rules": {
    "EXTENSIONS.DEPENDENCY_CYCLE": "Extension dependencies must be acyclic.",
    "EXTENSIONS.FILE_INVALID": "An extension schema, specification, implementation, or test file must have the required role and format.",
    "EXTENSIONS.PAYLOAD_INVALID": "An extension payload must match its bundled schema.",
    "EXTENSIONS.SCHEMA_INVALID": "An extension schema must be a supported local JSON Schema draft 2020-12 document.",
    "EXTENSIONS.SLOT_INVALID": "An extension use must match the slot its definition fills.",
    "FILES.EXTERNAL_DATA_FILE_INVALID": "An external tensor-data location must use a model file.",
    "FILES.EXTERNAL_DATA_MISMATCH": "External data locations must match the graph.",
    "FUNCTIONS.GRAPH_BINDING_INVALID": "Function ports must map to graph ports exactly once.",
    "FUNCTIONS.GRAPH_TYPE_MISMATCH": "Function and graph port types must agree.",
    "FUNCTIONS.GRAPH_TYPE_UNRESOLVED": "A graph value needs a full type before its interface can be checked.",
    "GRAPH.ATTRIBUTE_REFERENCE_INVALID": "An attribute reference must name an enclosing function attribute with the same type.",
    "GRAPH.CALL_ATTRIBUTES_INVALID": "A local function call must supply its required attributes with the declared types.",
    "GRAPH.CYCLE": "Node dataflow must not form a cycle.",
    "GRAPH.FILE_INVALID": "An authoritative graph must be a JSON file with role model.",
    "GRAPH.FUNCTION_ATTRIBUTES_INVALID": "A local function must have distinct attribute names and literal defaults.",
    "GRAPH.LOCAL_FUNCTION_DUPLICATE": "Each local function must have a distinct domain, name, and overload.",
    "GRAPH.NAME_DUPLICATE": "Each boundary list must contain unique value names.",
    "GRAPH.SOURCE_INVALID": "An optional graph source must be a file with role model.",
    "GRAPH.SPARSE_SHAPE_INVALID": "Sparse values and indices must agree with the dense shape.",
    "GRAPH.TENSOR_BYTE_SIZE_MISMATCH": "A tensor's data byte count must match its type and source.",
    "GRAPH.TENSOR_COUNT_MISMATCH": "The number of tensor values must match its shape.",
    "GRAPH.TENSOR_DATA_CONFLICT": "A public tensor must have only one data source.",
    "GRAPH.TENSOR_DATA_REQUIRED": "Every public tensor must have exact inline values or an exact bundled-data slice.",
    "GRAPH.TENSOR_EXTERNAL_RANGE_INVALID": "An external tensor-data slice must fit its bundled file.",
    "GRAPH.TENSOR_SHAPE_INVALID": "An initializer or attribute tensor must have numeric dimensions and at most 2^53 - 1 elements.",
    "GRAPH.TENSOR_VALUE_INVALID": "Every inline tensor value must fit its declared element type.",
    "GRAPH.TYPE_CONFLICT": "Two declarations of one graph value must state the same type.",
    "GRAPH.VALUE_NOT_FOUND": "A graph value must be defined before use.",
    "GRAPH.VALUE_REDEFINED": "Each graph value must be defined once.",
    "OPERATORS.ATTRIBUTES_INVALID": "A standard operator's attributes must match its ONNX schema.",
    "OPERATORS.COUNT_MISMATCH": "An operator use count must match the graphs.",
    "OPERATORS.DEFINITION_INVALID": "A local or extension operator definition must be complete and internally valid.",
    "OPERATORS.DUPLICATE": "An operator must have exactly one registry entry.",
    "OPERATORS.INPUTS_INVALID": "A standard operator's inputs must match its ONNX schema.",
    "OPERATORS.LOCAL_FUNCTION_CYCLE": "Local function definitions must not depend on themselves through operator calls.",
    "OPERATORS.LOCAL_FUNCTION_NOT_FOUND": "Every local operator must have a function definition.",
    "OPERATORS.NODE_INVALID": "A node must follow its operator definition.",
    "OPERATORS.NOT_REGISTERED": "Every applied operator must have a registry entry.",
    "OPERATORS.OPSET_UNSUPPORTED": "A standard operator must use an opset in the checked ONNX catalog.",
    "OPERATORS.OUTPUTS_INVALID": "A standard operator's outputs must match its ONNX schema.",
    "OPERATORS.SCHEMA_NOT_FOUND": "A standard operator must resolve to an ONNX schema.",
    "OPERATORS.SEMANTICS_INVALID": "An operator meaning must agree with its domain.",
    "OPERATORS.SYSTEM_INVALID": "Every node in a graph must use its declared operator system and environment.",
    "OPERATORS.TORCH_STATE_INVALID": "Torch module parameters and buffers must read private weight ports.",
    "OPTIMIZE.BODY_KIND_INVALID": "A target selection must match the body kind.",
    "OPTIMIZE.NOT_CONVEX": "A path between selected nodes or steps must stay inside the selection.",
    "OPTIMIZE.PATH_NOT_FOUND": "A target path must name existing steps.",
    "OPTIMIZE.SELECTION_NOT_FOUND": "A selected node or step must exist.",
    "OPTIMIZE.WORK_UNAVAILABLE": "A target can want a kind of work only when the request provides what that kind needs.",
    "OPTIMIZE.WORK_UNKNOWN": "A target can want only a kind of work of the published work table.",
    "WEIGHTS.DEFAULT_NOT_ALLOWED": "A replaceable weight graph input must not also be an initializer.",
    "WEIGHTS.GRAPH_BINDING_INVALID": "Each native graph tensor must bind to at most one weight port.",
    "WEIGHTS.GRAPH_TYPE_MISMATCH": "A logical weight port must match its graph tensor type.",
    "WEIGHTS.REFERENCE_NOT_FOUND": "A weight reference must name a weight port or slot.",
    "WEIGHTS.TENSOR_NOT_FOUND": "A weight port location must name a tensor of the graph.",
    "WEIGHTS.TIED_CONTRACT_MISMATCH": "Tied weights must have compatible declarations."
  }
}
