From 243d03da1f347c04d747ac90ee10e85cac20fbcc Mon Sep 17 00:00:00 2001 From: cmoineau <cyril.moineau@cea.fr> Date: Mon, 26 Aug 2024 12:58:54 +0000 Subject: [PATCH] Operator register now return an object instead of a function. --- aidge_core/export_utils/export_registry.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/aidge_core/export_utils/export_registry.py b/aidge_core/export_utils/export_registry.py index fc1bb1f2c..e6b2324b0 100644 --- a/aidge_core/export_utils/export_registry.py +++ b/aidge_core/export_utils/export_registry.py @@ -111,8 +111,9 @@ def operator_register(lib: ExportLib, key: str, *args): """Helper decorator to register an :py:class:`ExportNode` to an :py:class:`ExportLib` """ def decorator(operator): - def wrapper(*args, **kwargs): - return operator(*args, **kwargs) + class Wrapper(operator): + def __init__(self, *args, **kwargs): + return operator(*args, **kwargs) lib.add_export_node(key, operator) - return wrapper + return Wrapper return decorator -- GitLab