From c84226ffada1088cc14ad022ccda262f70eaae05 Mon Sep 17 00:00:00 2001 From: jvreca Date: Fri, 13 Sep 2024 15:46:34 +0200 Subject: [PATCH] moved function get_preferred_onnx_opset to avoid circular commit --- src/qonnx/custom_op/registry.py | 7 +++++-- src/qonnx/util/basic.py | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/qonnx/custom_op/registry.py b/src/qonnx/custom_op/registry.py index 65b8b2ba..cefc0973 100644 --- a/src/qonnx/custom_op/registry.py +++ b/src/qonnx/custom_op/registry.py @@ -28,8 +28,6 @@ import importlib -from qonnx.util.basic import get_preferred_onnx_opset - _QONNX_DOMAINS = ["finn", "qonnx.custom_op", "onnx.brevitas"] @@ -45,6 +43,11 @@ def is_finn_op(op_type): return is_finn +def get_preferred_onnx_opset(): + "Return preferred ONNX opset version for QONNX" + return 11 + + def getCustomOp(node, onnx_opset_version=get_preferred_onnx_opset(), brevitas_exception=True): "Return a QONNX CustomOp instance for the given ONNX node, if it exists." op_type = node.op_type diff --git a/src/qonnx/util/basic.py b/src/qonnx/util/basic.py index 7c1560ed..d91844da 100644 --- a/src/qonnx/util/basic.py +++ b/src/qonnx/util/basic.py @@ -51,7 +51,7 @@ def get_preferred_onnx_opset(): "Return preferred ONNX opset version for QONNX" - return 11 + return qonnx.custom_op.registry.get_preferred_onnx_opset() def qonnx_make_model(graph_proto, **kwargs):