From 13a2a1b9c8452768c32ad404e3a6aa21c84cc4ca Mon Sep 17 00:00:00 2001 From: Christoph Berganski Date: Tue, 28 Jan 2025 16:07:23 +0100 Subject: [PATCH] Add GiveUniqueParameterTensors to ModelWrapper.cleanup transformations Fixes transformations which create copies of nodes without copying parameter tensors, resulting in unwanted entanglement. This manifests as later transformations having non-local effects, manipulating seemingly unrelated nodes. --- src/qonnx/core/modelwrapper.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/qonnx/core/modelwrapper.py b/src/qonnx/core/modelwrapper.py index c7b2c676..fffb7424 100644 --- a/src/qonnx/core/modelwrapper.py +++ b/src/qonnx/core/modelwrapper.py @@ -44,6 +44,7 @@ from qonnx.transformation.general import ( RemoveStaticGraphInputs, RemoveUnusedTensors, + GiveUniqueParameterTensors, SortCommutativeInputsInitializerLast, SortGraph, ) @@ -209,6 +210,7 @@ def cleanup(self): RemoveStaticGraphInputs(), SortGraph(), SortCommutativeInputsInitializerLast(), + GiveUniqueParameterTensors(), ] for trn in cleanup_transforms: transformed_model = transformed_model.transform(trn, cleanup=False, make_deepcopy=False)