Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into shape-inference-failure
Browse files Browse the repository at this point in the history
  • Loading branch information
adityagoel4512 committed Oct 23, 2023
2 parents 67eaacf + 701e8ba commit d820247
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 11 deletions.
21 changes: 18 additions & 3 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,34 @@
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.


0.9.0 (2023-06-12)
------------------

**New features**
**New feature**

- The opset ``ai.onnx@19`` (ONNX 1.14) is now shipped with Spox.

Expand All @@ -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.

Expand Down
8 changes: 4 additions & 4 deletions src/spox/_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -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``."""
Expand Down
8 changes: 4 additions & 4 deletions src/spox/_public.py
Original file line number Diff line number Diff line change
Expand Up @@ -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. "
Expand Down

0 comments on commit d820247

Please sign in to comment.