Skip to content

Commit

Permalink
Clean up and regression-test schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
cbourjau committed Oct 1, 2024
1 parent aab4d2a commit a575d02
Show file tree
Hide file tree
Showing 29 changed files with 182 additions and 40 deletions.
7 changes: 5 additions & 2 deletions ndonnx/_logic_in_data/_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,14 @@ def unwrap_numpy(self) -> np.ndarray:
"""
return self._data.unwrap_numpy()

def to_numpy(self) -> np.ndarray:
def to_numpy(self) -> np.ndarray | None:
from warnings import warn

warn("'to_numpy' is deprecated in favor of 'unwrap_numpy'", DeprecationWarning)
return self.unwrap_numpy()
try:
return self.unwrap_numpy()
except ValueError:
return None

def __getitem__(self, key: GetitemIndex, /) -> Array:
from ._typed_array import TyArrayBool, TyArrayInteger
Expand Down
13 changes: 8 additions & 5 deletions ndonnx/_logic_in_data/_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,16 @@ def build(arguments: dict[str, Array], results: dict[str, Array]) -> onnx.ModelP
mp = spox_build(ins, outs, drop_unused_inputs=True)

metadata = {
"schemas": json.dumps(
"ndonnx": json.dumps(
{
"arguments": json.loads(_json_schema(arguments)),
"results": json.loads(_json_schema(results)),
"schemas": {
"arguments": json.loads(_json_schema(arguments)),
"results": json.loads(_json_schema(results)),
},
# Version for how we organize our metadata in general
"metadata_version": "1",
}
),
"ndonnx_schema_version": "1",
)
}
onnx.helper.set_model_props(mp, metadata)

Expand Down
71 changes: 46 additions & 25 deletions ndonnx/_logic_in_data/_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,58 @@

import json
from dataclasses import dataclass
from typing import TYPE_CHECKING, Any, Literal
from typing import Any, Literal

import numpy as np
import onnx

if TYPE_CHECKING:
from spox import Var
from typing_extensions import Self

Json = dict[str, "Json"] | list["Json"] | str | int | float | bool | None
PrimitiveComponent = Literal[
"float16",
"float32",
"float64",
"int8",
"int16",
"int32",
"int64",
"uint8",
"uint16",
"uint32",
"uint64",
"bool",
"str",
]
StructComponent = dict[str, "Schema"]
Components = dict[str, Var]
from spox import Var
from typing_extensions import Self

Json = dict[str, "Json"] | list["Json"] | str | int | float | bool | None
"""A JSON serializable object."""

PrimitiveComponent = Literal[
"float16",
"float32",
"float64",
"int8",
"int16",
"int32",
"int64",
"uint8",
"uint16",
"uint32",
"uint64",
"bool",
"str",
]
"""Primitive type with an equivalent type in the ONNX standard."""

StructComponent = dict[str, "Schema"]
"""A composite type consisting of other ``StructComponents`` or ``PrimitiveTypes``."""

Components = dict[str, Var]
"""A flattened representation of the components of an array with arbitrary data type."""


@dataclass
class DTypeInfo:
"""Class returned by ``DType._info`` describing the respective data type."""

defining_library: str
# Version of this particular data type
version: int
dtype: str
dtype_state: Json


@dataclass
class Schema:
"""Schema describing a data type.
The names are suffixes of the names ultimately used in the model API.
"""

dtype_info: DTypeInfo
components: PrimitiveComponent | StructComponent

Expand Down Expand Up @@ -110,7 +123,15 @@ class Schemas:

def get_schemas(mp: onnx.ModelProto) -> Schemas:
metadict = {el.key: el.value for el in mp.metadata_props}
schema_dict = json.loads(metadict["schemas"])
return _get_schemas(metadict)


def _get_schemas(metadata: dict[str, str]) -> Schemas:
"""Get ``Schemas`` from metadata dict.
This function is factored out from ``get_schemas`` for easier testing.
"""
schema_dict = json.loads(metadata["ndonnx"])["schemas"]

arguments = {k: Schema.from_json(v, 1) for k, v in schema_dict["arguments"].items()}
results = {k: Schema.from_json(v, 1) for k, v in schema_dict["results"].items()}
Expand Down
2 changes: 1 addition & 1 deletion ndonnx/_logic_in_data/_typed_array/onnx.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ def unwrap_numpy(self) -> np.ndarray:
# TODO: Where does the "object" kind come from?
# Probably spox; we should have a more predictable
# upstream string support.
return np_arr
return np_arr.astype(str)

# Should not happen
raise ValueError("unexpected value data type")
Expand Down
3 changes: 3 additions & 0 deletions tests/schemas/Bool.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"ndonnx": "{\"schemas\": {\"arguments\": {\"a\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Bool\", \"dtype_state\": null}, \"components\": \"bool\"}}, \"results\": {\"b\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Bool\", \"dtype_state\": null}, \"components\": \"bool\"}}}, \"metadata_version\": \"1\"}"
}
3 changes: 3 additions & 0 deletions tests/schemas/Float32.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"ndonnx": "{\"schemas\": {\"arguments\": {\"a\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Float32\", \"dtype_state\": null}, \"components\": \"float32\"}}, \"results\": {\"b\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Float32\", \"dtype_state\": null}, \"components\": \"float32\"}}}, \"metadata_version\": \"1\"}"
}
3 changes: 3 additions & 0 deletions tests/schemas/Float64.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"ndonnx": "{\"schemas\": {\"arguments\": {\"a\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Float64\", \"dtype_state\": null}, \"components\": \"float64\"}}, \"results\": {\"b\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Float64\", \"dtype_state\": null}, \"components\": \"float64\"}}}, \"metadata_version\": \"1\"}"
}
3 changes: 3 additions & 0 deletions tests/schemas/Int16.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"ndonnx": "{\"schemas\": {\"arguments\": {\"a\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Int16\", \"dtype_state\": null}, \"components\": \"int16\"}}, \"results\": {\"b\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Int16\", \"dtype_state\": null}, \"components\": \"int16\"}}}, \"metadata_version\": \"1\"}"
}
3 changes: 3 additions & 0 deletions tests/schemas/Int32.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"ndonnx": "{\"schemas\": {\"arguments\": {\"a\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Int32\", \"dtype_state\": null}, \"components\": \"int32\"}}, \"results\": {\"b\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Int32\", \"dtype_state\": null}, \"components\": \"int32\"}}}, \"metadata_version\": \"1\"}"
}
3 changes: 3 additions & 0 deletions tests/schemas/Int64.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"ndonnx": "{\"schemas\": {\"arguments\": {\"a\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Int64\", \"dtype_state\": null}, \"components\": \"int64\"}}, \"results\": {\"b\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Int64\", \"dtype_state\": null}, \"components\": \"int64\"}}}, \"metadata_version\": \"1\"}"
}
3 changes: 3 additions & 0 deletions tests/schemas/Int8.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"ndonnx": "{\"schemas\": {\"arguments\": {\"a\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Int8\", \"dtype_state\": null}, \"components\": \"int8\"}}, \"results\": {\"b\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Int8\", \"dtype_state\": null}, \"components\": \"int8\"}}}, \"metadata_version\": \"1\"}"
}
3 changes: 3 additions & 0 deletions tests/schemas/NBool.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"ndonnx": "{\"schemas\": {\"arguments\": {\"a\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"NBool\", \"dtype_state\": null}, \"components\": {\"data\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Bool\", \"dtype_state\": null}, \"components\": \"bool\"}, \"mask\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Bool\", \"dtype_state\": null}, \"components\": \"bool\"}}}}, \"results\": {\"b\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"NBool\", \"dtype_state\": null}, \"components\": {\"data\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Bool\", \"dtype_state\": null}, \"components\": \"bool\"}, \"mask\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Bool\", \"dtype_state\": null}, \"components\": \"bool\"}}}}}, \"metadata_version\": \"1\"}"
}
3 changes: 3 additions & 0 deletions tests/schemas/NFloat32.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"ndonnx": "{\"schemas\": {\"arguments\": {\"a\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"NFloat32\", \"dtype_state\": null}, \"components\": {\"data\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Float32\", \"dtype_state\": null}, \"components\": \"float32\"}, \"mask\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Bool\", \"dtype_state\": null}, \"components\": \"bool\"}}}}, \"results\": {\"b\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"NFloat32\", \"dtype_state\": null}, \"components\": {\"data\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Float32\", \"dtype_state\": null}, \"components\": \"float32\"}, \"mask\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Bool\", \"dtype_state\": null}, \"components\": \"bool\"}}}}}, \"metadata_version\": \"1\"}"
}
3 changes: 3 additions & 0 deletions tests/schemas/NFloat64.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"ndonnx": "{\"schemas\": {\"arguments\": {\"a\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"NFloat64\", \"dtype_state\": null}, \"components\": {\"data\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Float64\", \"dtype_state\": null}, \"components\": \"float64\"}, \"mask\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Bool\", \"dtype_state\": null}, \"components\": \"bool\"}}}}, \"results\": {\"b\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"NFloat64\", \"dtype_state\": null}, \"components\": {\"data\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Float64\", \"dtype_state\": null}, \"components\": \"float64\"}, \"mask\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Bool\", \"dtype_state\": null}, \"components\": \"bool\"}}}}}, \"metadata_version\": \"1\"}"
}
3 changes: 3 additions & 0 deletions tests/schemas/NInt16.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"ndonnx": "{\"schemas\": {\"arguments\": {\"a\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"NInt16\", \"dtype_state\": null}, \"components\": {\"data\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Int16\", \"dtype_state\": null}, \"components\": \"int16\"}, \"mask\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Bool\", \"dtype_state\": null}, \"components\": \"bool\"}}}}, \"results\": {\"b\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"NInt16\", \"dtype_state\": null}, \"components\": {\"data\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Int16\", \"dtype_state\": null}, \"components\": \"int16\"}, \"mask\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Bool\", \"dtype_state\": null}, \"components\": \"bool\"}}}}}, \"metadata_version\": \"1\"}"
}
3 changes: 3 additions & 0 deletions tests/schemas/NInt32.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"ndonnx": "{\"schemas\": {\"arguments\": {\"a\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"NInt32\", \"dtype_state\": null}, \"components\": {\"data\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Int32\", \"dtype_state\": null}, \"components\": \"int32\"}, \"mask\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Bool\", \"dtype_state\": null}, \"components\": \"bool\"}}}}, \"results\": {\"b\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"NInt32\", \"dtype_state\": null}, \"components\": {\"data\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Int32\", \"dtype_state\": null}, \"components\": \"int32\"}, \"mask\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Bool\", \"dtype_state\": null}, \"components\": \"bool\"}}}}}, \"metadata_version\": \"1\"}"
}
3 changes: 3 additions & 0 deletions tests/schemas/NInt64.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"ndonnx": "{\"schemas\": {\"arguments\": {\"a\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"NInt64\", \"dtype_state\": null}, \"components\": {\"data\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Int64\", \"dtype_state\": null}, \"components\": \"int64\"}, \"mask\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Bool\", \"dtype_state\": null}, \"components\": \"bool\"}}}}, \"results\": {\"b\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"NInt64\", \"dtype_state\": null}, \"components\": {\"data\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Int64\", \"dtype_state\": null}, \"components\": \"int64\"}, \"mask\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Bool\", \"dtype_state\": null}, \"components\": \"bool\"}}}}}, \"metadata_version\": \"1\"}"
}
3 changes: 3 additions & 0 deletions tests/schemas/NInt8.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"ndonnx": "{\"schemas\": {\"arguments\": {\"a\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"NInt8\", \"dtype_state\": null}, \"components\": {\"data\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Int8\", \"dtype_state\": null}, \"components\": \"int8\"}, \"mask\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Bool\", \"dtype_state\": null}, \"components\": \"bool\"}}}}, \"results\": {\"b\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"NInt8\", \"dtype_state\": null}, \"components\": {\"data\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Int8\", \"dtype_state\": null}, \"components\": \"int8\"}, \"mask\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Bool\", \"dtype_state\": null}, \"components\": \"bool\"}}}}}, \"metadata_version\": \"1\"}"
}
3 changes: 3 additions & 0 deletions tests/schemas/NString.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"ndonnx": "{\"schemas\": {\"arguments\": {\"a\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"NString\", \"dtype_state\": null}, \"components\": {\"data\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"String\", \"dtype_state\": null}, \"components\": \"str\"}, \"mask\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Bool\", \"dtype_state\": null}, \"components\": \"bool\"}}}}, \"results\": {\"b\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"NString\", \"dtype_state\": null}, \"components\": {\"data\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"String\", \"dtype_state\": null}, \"components\": \"str\"}, \"mask\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Bool\", \"dtype_state\": null}, \"components\": \"bool\"}}}}}, \"metadata_version\": \"1\"}"
}
3 changes: 3 additions & 0 deletions tests/schemas/NUint16.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"ndonnx": "{\"schemas\": {\"arguments\": {\"a\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"NUint16\", \"dtype_state\": null}, \"components\": {\"data\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Uint16\", \"dtype_state\": null}, \"components\": \"uint16\"}, \"mask\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Bool\", \"dtype_state\": null}, \"components\": \"bool\"}}}}, \"results\": {\"b\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"NUint16\", \"dtype_state\": null}, \"components\": {\"data\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Uint16\", \"dtype_state\": null}, \"components\": \"uint16\"}, \"mask\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Bool\", \"dtype_state\": null}, \"components\": \"bool\"}}}}}, \"metadata_version\": \"1\"}"
}
3 changes: 3 additions & 0 deletions tests/schemas/NUint32.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"ndonnx": "{\"schemas\": {\"arguments\": {\"a\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"NUint32\", \"dtype_state\": null}, \"components\": {\"data\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Uint32\", \"dtype_state\": null}, \"components\": \"uint32\"}, \"mask\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Bool\", \"dtype_state\": null}, \"components\": \"bool\"}}}}, \"results\": {\"b\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"NUint32\", \"dtype_state\": null}, \"components\": {\"data\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Uint32\", \"dtype_state\": null}, \"components\": \"uint32\"}, \"mask\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Bool\", \"dtype_state\": null}, \"components\": \"bool\"}}}}}, \"metadata_version\": \"1\"}"
}
3 changes: 3 additions & 0 deletions tests/schemas/NUint64.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"ndonnx": "{\"schemas\": {\"arguments\": {\"a\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"NUint64\", \"dtype_state\": null}, \"components\": {\"data\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Uint64\", \"dtype_state\": null}, \"components\": \"uint64\"}, \"mask\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Bool\", \"dtype_state\": null}, \"components\": \"bool\"}}}}, \"results\": {\"b\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"NUint64\", \"dtype_state\": null}, \"components\": {\"data\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Uint64\", \"dtype_state\": null}, \"components\": \"uint64\"}, \"mask\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Bool\", \"dtype_state\": null}, \"components\": \"bool\"}}}}}, \"metadata_version\": \"1\"}"
}
3 changes: 3 additions & 0 deletions tests/schemas/NUint8.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"ndonnx": "{\"schemas\": {\"arguments\": {\"a\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"NUint8\", \"dtype_state\": null}, \"components\": {\"data\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Uint8\", \"dtype_state\": null}, \"components\": \"uint8\"}, \"mask\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Bool\", \"dtype_state\": null}, \"components\": \"bool\"}}}}, \"results\": {\"b\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"NUint8\", \"dtype_state\": null}, \"components\": {\"data\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Uint8\", \"dtype_state\": null}, \"components\": \"uint8\"}, \"mask\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Bool\", \"dtype_state\": null}, \"components\": \"bool\"}}}}}, \"metadata_version\": \"1\"}"
}
3 changes: 3 additions & 0 deletions tests/schemas/String.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"ndonnx": "{\"schemas\": {\"arguments\": {\"a\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"String\", \"dtype_state\": null}, \"components\": \"str\"}}, \"results\": {\"b\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"String\", \"dtype_state\": null}, \"components\": \"str\"}}}, \"metadata_version\": \"1\"}"
}
3 changes: 3 additions & 0 deletions tests/schemas/Uint16.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"ndonnx": "{\"schemas\": {\"arguments\": {\"a\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Uint16\", \"dtype_state\": null}, \"components\": \"uint16\"}}, \"results\": {\"b\": {\"dtype_info\": {\"defining_library\": \"ndonnx\", \"version\": 1, \"dtype\": \"Uint16\", \"dtype_state\": null}, \"components\": \"uint16\"}}}, \"metadata_version\": \"1\"}"
}
Loading

0 comments on commit a575d02

Please sign in to comment.