@@ -1278,6 +1278,11 @@ def _short_tensor_str_for_node(x: Value) -> str:
12781278 return "{...}"
12791279
12801280
1281+ def _normalize_domain (domain : str ) -> str :
1282+ """Normalize 'ai.onnx' to ''"""
1283+ return "" if domain == "ai.onnx" else domain
1284+
1285+
12811286class Node (_protocols .NodeProtocol , _display .PrettyPrintable ):
12821287 """IR Node.
12831288
@@ -1328,6 +1333,7 @@ def __init__(
13281333
13291334 Args:
13301335 domain: The domain of the operator. For onnx operators, this is an empty string.
1336+ When it is "ai.onnx", it is normalized to "".
13311337 op_type: The name of the operator.
13321338 inputs: The input values. When an input is ``None``, it is an empty input.
13331339 attributes: The attributes. RefAttr can be used only when the node is defined in a Function.
@@ -1350,7 +1356,7 @@ def __init__(
13501356 ValueError: If an output value has a producer set already, when outputs is specified.
13511357 """
13521358 self ._name = name
1353- self ._domain : str = domain
1359+ self ._domain : str = _normalize_domain ( domain )
13541360 self ._op_type : str = op_type
13551361 # NOTE: Make inputs immutable with the assumption that they are not mutated
13561362 # very often. This way all mutations can be tracked.
@@ -1482,7 +1488,7 @@ def domain(self) -> str:
14821488
14831489 @domain .setter
14841490 def domain (self , value : str ) -> None :
1485- self ._domain = value
1491+ self ._domain = _normalize_domain ( value )
14861492
14871493 @property
14881494 def version (self ) -> int | None :
@@ -2885,7 +2891,7 @@ def domain(self) -> str:
28852891
28862892 @domain .setter
28872893 def domain (self , value : str ) -> None :
2888- self ._domain = value
2894+ self ._domain = _normalize_domain ( value )
28892895
28902896 @property
28912897 def overload (self ) -> str :
0 commit comments