diff --git a/CHANGELOG.rst b/CHANGELOG.rst index d54de931..c2226a06 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -7,11 +7,26 @@ Change log ========== -0.9.1 (2023-10-05) +0.9.3 (Unreleased) ------------------ **Bug fix** +- Address missing Value Infos when building singleton model for shape inference. + + +0.9.2 (2023-10-20) +------------------ + +**Other changes** + +- Fix a deprecation warning from one of Spox's dependencies. + +0.9.1 (2023-10-05) +------------------ + +**Bug fixes** + - The node-adaption no longer fails if faced with a node that has repeating inputs. - Forego version adaption of inlined models if no nodes are from the default domain. @@ -19,7 +34,7 @@ Change log 0.9.0 (2023-06-12) ------------------ -**New features** +**New feature** - The opset ``ai.onnx@19`` (ONNX 1.14) is now shipped with Spox. @@ -36,7 +51,7 @@ Change log 0.8.1 (2023-05-xx) ------------------ -**Bug fixes** +**Bug fixe** - An explicit error is now raised when local subgraph arguments are leaked to an outer scope. This may happen when the subgraph callback uses side effects saving local variables, which would produce later a confusing error message. diff --git a/src/spox/_graph.py b/src/spox/_graph.py index 41f9262b..6d0426f3 100644 --- a/src/spox/_graph.py +++ b/src/spox/_graph.py @@ -150,13 +150,13 @@ def __repr__(self): def __post_init__(self): if any(not isinstance(var, Var) for var in self._results.values()): - types = {type(obj) for obj in self._results.values()} - {Var} - raise TypeError(f"Graph results must be Vars, not {types}.") + seen_types = {type(obj) for obj in self._results.values()} + raise TypeError(f"Graph results must be Vars, not {seen_types - {Var}}.") if self._arguments is not None and any( not isinstance(var, Var) for var in self._arguments ): - types = {type(obj) for obj in self._arguments} - {Var} - raise TypeError(f"Graph results must be Vars, not {types}.") + seen_types = {type(obj) for obj in self._arguments} + raise TypeError(f"Build outputs must be Vars, not {seen_types - {Var}}.") def with_name(self, name: str) -> "Graph": """Return a Graph with its name set to ``name``.""" diff --git a/src/spox/_public.py b/src/spox/_public.py index 989c5bfa..d203b62a 100644 --- a/src/spox/_public.py +++ b/src/spox/_public.py @@ -98,11 +98,11 @@ def build(inputs: Dict[str, Var], outputs: Dict[str, Var]) -> onnx.ModelProto: >>> model = build({'a': a, 'b': b, 'c': c}, {'r': q}) """ if not all(isinstance(var, Var) for var in inputs.values()): - input_types = {type(obj) for obj in inputs.values()} - {Var} - raise TypeError(f"Build inputs must be Vars, not {input_types}.") + seen_types = {type(obj) for obj in inputs.values()} + raise TypeError(f"Build inputs must be Vars, not {seen_types - {Var}}.") if not all(isinstance(var, Var) for var in outputs.values()): - output_types = {type(obj) for obj in outputs.values()} - {Var} - raise TypeError(f"Build outputs must be Vars, not {output_types}.") + seen_types = {type(obj) for obj in outputs.values()} + raise TypeError(f"Build outputs must be Vars, not {seen_types - {Var}}.") if not all(isinstance(var._op, Argument) for var in inputs.values()): raise TypeError( "Build inputs must be `Var`s constructed using the `spox.argument` function. "