From 726d6a3d62cfb19d0feecd40fc2df30b7c81a127 Mon Sep 17 00:00:00 2001
From: Axel Farrugia <axel.farrugia@cea.fr>
Date: Fri, 2 May 2025 13:48:44 +0200
Subject: [PATCH] [Chore](R18) Round the tensor after rescaling

---
 examples/export_ResNet18/resnet18.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/examples/export_ResNet18/resnet18.py b/examples/export_ResNet18/resnet18.py
index 935cf96..e39daf8 100644
--- a/examples/export_ResNet18/resnet18.py
+++ b/examples/export_ResNet18/resnet18.py
@@ -333,6 +333,7 @@ if quantize_model:
     rescaling = 2**(NB_BITS-1)-1
     for i in range(max(NB_TEST, NB_CALIB)):
         array = np.array(aidge_tensors[i]) * rescaling 
+        array = np.round(array).astype(int)
         aidge_tensors[i] = aidge_core.Tensor(array)
         aidge_tensors[i].set_datatype(TARGET_TYPE)
 
-- 
GitLab