From 1b3bb03854fac102969c897952da66c116a4aa07 Mon Sep 17 00:00:00 2001
From: cmoineau <cyril.moineau@cea.fr>
Date: Fri, 11 Oct 2024 14:46:50 +0000
Subject: [PATCH] Fix python unit test.

---
 aidge_backend_cpu/unit_tests/test_scheduler.py | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/aidge_backend_cpu/unit_tests/test_scheduler.py b/aidge_backend_cpu/unit_tests/test_scheduler.py
index 0aeeb04b..2d243e31 100644
--- a/aidge_backend_cpu/unit_tests/test_scheduler.py
+++ b/aidge_backend_cpu/unit_tests/test_scheduler.py
@@ -13,28 +13,25 @@ class test_scheduler(unittest.TestCase):
         pass
 
     def test_relu_forward(self):
-        values = np.arange(6) - 3
 
-        input_node = aidge_core.Producer(aidge_core.Tensor(values), "Input")
+        t = aidge_core.Tensor(np.arange(6, dtype=np.int32) - 3)
+
         relu = aidge_core.ReLU()
 
         gv = aidge_core.GraphView()
         gv.add(relu)
-        gv.add(input_node)
-
-        input_node.add_child(relu)
 
         gv.set_datatype(aidge_core.dtype.int32)
         gv.set_backend("cpu")
 
         scheduler = aidge_core.SequentialScheduler(gv)
 
-        scheduler.forward()
+        scheduler.forward(data=[t])
 
         out_tensor = relu.get_operator().get_output(0)
         expected_out = [0,0,0,0,1,2]
         for i in range(len(expected_out)):
-            self.assertEqual(expected_out[i], out_tensor[i])
+            self.assertEqual(expected_out[i], out_tensor[i], f"On idx {i}")
 
     def test_sequential_scheduling(self):
         input_data =  np.array([0]).astype(np.float32)
-- 
GitLab