diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 02c73b7c..ea6b04bf 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -15,6 +15,10 @@ Change log - Improved node creation speed by skipping the storing of the traceback - :class:`spox.Var` objects may now be shallow copied. Deep copies are explicitly prohibited. +**Bug fix** + +- Addresses node adaptation failure when referencing a non-input name from inside a subgraph by aborting opset adaptation. + 0.10.2 (2023-02-08) ------------------- diff --git a/src/spox/_adapt.py b/src/spox/_adapt.py index ce65c2a9..42f8f514 100644 --- a/src/spox/_adapt.py +++ b/src/spox/_adapt.py @@ -5,6 +5,7 @@ import onnx import onnx.version_converter +from ._attributes import AttrGraph from ._inline import _Inline from ._internal_op import _InternalNode from ._node import Node @@ -108,6 +109,8 @@ def adapt_best_effort( ) if isinstance(node, _InternalNode) or len(protos) != 1: return None + if any(isinstance(attr, AttrGraph) for attr in node.attrs.get_fields().values()): + return None proto: onnx.NodeProto (proto,) = protos domain = proto.domain if proto.domain != "ai.onnx" else ""