Skip to content

Commit

Permalink
Update CHANGELOG.rst (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
cbourjau authored Oct 20, 2023
1 parent 45a60a1 commit 701e8ba
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
11 changes: 9 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@
Change log
==========

0.9.2 (2023-10-20)
------------------

**Other changes**

- Fix a deprecation warning from one of Spox's dependencies.

0.9.1 (2023-10-05)
------------------

Expand All @@ -19,7 +26,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.

Expand All @@ -36,7 +43,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
10 changes: 4 additions & 6 deletions src/spox/_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,13 @@ def __repr__(self):

def __post_init__(self):
if any(not isinstance(var, Var) for var in self._results.values()):
raise TypeError(
f"Graph results must be Vars, not {set(type(obj) for obj in self._results.values()) - {Var}}."
)
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
):
raise TypeError(
f"Graph results must be Vars, not {set(type(obj) for obj in self._arguments) - {Var}}."
)
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
10 changes: 4 additions & 6 deletions src/spox/_public.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +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()):
raise TypeError(
f"Build inputs must be Vars, not {set(type(obj) for obj in inputs.values()) - {Var} }."
)
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()):
raise TypeError(
f"Build outputs must be Vars, not {set(type(obj) for obj in outputs.values()) - {Var} }."
)
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 701e8ba

Please sign in to comment.