From c05db6856b6f9168eb54f7a11fe67f226b726bc2 Mon Sep 17 00:00:00 2001
From: NAUD Maxence <maxence.naud@cea.fr>
Date: Mon, 10 Mar 2025 16:35:20 +0000
Subject: [PATCH] fix wrong python binding

---
 include/aidge/analysis/OperatorStats.hpp      |  1 +
 include/aidge/data/Tensor.hpp                 | 41 +++++++++----------
 include/aidge/operator/And.hpp                |  2 +-
 .../analysis/pybind_DynamicAnalysis.cpp       |  2 +-
 4 files changed, 22 insertions(+), 24 deletions(-)

diff --git a/include/aidge/analysis/OperatorStats.hpp b/include/aidge/analysis/OperatorStats.hpp
index c9f2bb7c2..ca11e76b7 100644
--- a/include/aidge/analysis/OperatorStats.hpp
+++ b/include/aidge/analysis/OperatorStats.hpp
@@ -18,6 +18,7 @@
 #include <memory>
 #include <string>
 
+#include "aidge/graph/Node.hpp"
 #include "aidge/operator/Operator.hpp"
 #include "aidge/utils/Registrar.hpp"
 
diff --git a/include/aidge/data/Tensor.hpp b/include/aidge/data/Tensor.hpp
index 09c69d64b..9c72b5975 100644
--- a/include/aidge/data/Tensor.hpp
+++ b/include/aidge/data/Tensor.hpp
@@ -117,12 +117,12 @@ class Tensor : public Data,
     template <typename T, std::size_t SIZE_0>
     constexpr Tensor(Array1D<T, SIZE_0> &&arr)
         : Data(Type),
-        mDataType(NativeType_v<T>),
-        mDataFormat(DataFormat::Default),
-        mDims({SIZE_0}),
-        mStrides({1}),
-        mImpl(Registrar<Tensor>::create({"cpu", NativeType_v<T>})(0, {SIZE_0})),
-        mSize(SIZE_0)
+          mDataType(NativeType_v<T>),
+          mDataFormat(DataFormat::Default),
+          mDims({SIZE_0}),
+          mStrides({1}),
+          mImpl(Registrar<Tensor>::create({"cpu", NativeType_v<T>})(0, {SIZE_0})),
+          mSize(SIZE_0)
     {
         mImpl->copyFromHost(&arr.data[0], SIZE_0);
     }
@@ -141,8 +141,7 @@ class Tensor : public Data,
           mDims({SIZE_0, SIZE_1}),
           mStrides({SIZE_1, 1}),
           mImpl(Registrar<Tensor>::create({"cpu", NativeType_v<T>})(0, {SIZE_0, SIZE_1})),
-          mSize(SIZE_0 * SIZE_1)
-    {
+          mSize(SIZE_0 * SIZE_1) {
         mImpl->copyFromHost(&arr.data[0][0], SIZE_0 * SIZE_1);
     }
 
@@ -156,13 +155,12 @@ class Tensor : public Data,
     template <typename T, std::size_t SIZE_0, std::size_t SIZE_1, std::size_t SIZE_2>
     constexpr Tensor(Array3D<T, SIZE_0, SIZE_1, SIZE_2> &&arr)
         : Data(Type),
-        mDataType(NativeType_v<T>),
-        mDataFormat(DataFormat::Default),
-        mDims({SIZE_0, SIZE_1, SIZE_2}),
-        mStrides({SIZE_1 * SIZE_2, SIZE_2, 1}),
-        mImpl(Registrar<Tensor>::create({"cpu", NativeType_v<T>})(0, {SIZE_0, SIZE_1, SIZE_2})),
-        mSize(SIZE_0 * SIZE_1 * SIZE_2)
-    {
+          mDataType(NativeType_v<T>),
+          mDataFormat(DataFormat::Default),
+          mDims({SIZE_0, SIZE_1, SIZE_2}),
+          mStrides({SIZE_1 * SIZE_2, SIZE_2, 1}),
+          mImpl(Registrar<Tensor>::create({"cpu", NativeType_v<T>})(0, {SIZE_0, SIZE_1, SIZE_2})),
+          mSize(SIZE_0 * SIZE_1 * SIZE_2) {
         mImpl->copyFromHost(&arr.data[0][0][0], SIZE_0 * SIZE_1 * SIZE_2);
     }
 
@@ -177,13 +175,12 @@ class Tensor : public Data,
     template <typename T, std::size_t SIZE_0, std::size_t SIZE_1, std::size_t SIZE_2, std::size_t SIZE_3>
     constexpr Tensor(Array4D<T, SIZE_0, SIZE_1, SIZE_2, SIZE_3> &&arr)
         : Data(Type),
-        mDataType(NativeType_v<T>),
-        mDataFormat(DataFormat::Default),
-        mDims({SIZE_0, SIZE_1, SIZE_2, SIZE_3}),
-        mStrides({SIZE_1 * SIZE_2 * SIZE_3, SIZE_2 * SIZE_3, SIZE_3, 1}),
-        mImpl(Registrar<Tensor>::create({"cpu", NativeType_v<T>})(0, {SIZE_0, SIZE_1, SIZE_2, SIZE_3})),
-        mSize(SIZE_0 * SIZE_1 * SIZE_2 * SIZE_3)
-    {
+          mDataType(NativeType_v<T>),
+          mDataFormat(DataFormat::Default),
+          mDims({SIZE_0, SIZE_1, SIZE_2, SIZE_3}),
+          mStrides({SIZE_1 * SIZE_2 * SIZE_3, SIZE_2 * SIZE_3, SIZE_3, 1}),
+          mImpl(Registrar<Tensor>::create({"cpu", NativeType_v<T>})(0, {SIZE_0, SIZE_1, SIZE_2, SIZE_3})),
+          mSize(SIZE_0 * SIZE_1 * SIZE_2 * SIZE_3) {
         mImpl->copyFromHost(&arr.data[0][0][0][0], SIZE_0 * SIZE_1 * SIZE_2 * SIZE_3);
     }
 
diff --git a/include/aidge/operator/And.hpp b/include/aidge/operator/And.hpp
index 5c970cc43..b9f75f991 100644
--- a/include/aidge/operator/And.hpp
+++ b/include/aidge/operator/And.hpp
@@ -82,7 +82,7 @@ public:
     }
 };
 
-inline std::shared_ptr<Node> And(const std::string& name = "");
+std::shared_ptr<Node> And(const std::string& name = "");
 
 } // namespace Aidge
 
diff --git a/python_binding/analysis/pybind_DynamicAnalysis.cpp b/python_binding/analysis/pybind_DynamicAnalysis.cpp
index 3cd71f741..4c57a60e7 100644
--- a/python_binding/analysis/pybind_DynamicAnalysis.cpp
+++ b/python_binding/analysis/pybind_DynamicAnalysis.cpp
@@ -25,7 +25,7 @@ public:
 
 void init_DynamicAnalysis(py::module& m){
     py::class_<DynamicAnalysis, std::shared_ptr<DynamicAnalysis>, pyDynamicAnalysis>(m, "DynamicAnalysis", py::multiple_inheritance(), py::dynamic_attr())
-    .def(py::init<std::shared_ptr<GraphView>>(), py::arg("graph"))
+    .def(py::init<const Scheduler&>(), py::arg("scheduler"))
     .def("get_nb_arithm_ops", &DynamicAnalysis::getNbArithmOps)
     .def("get_nb_logic_ops", &DynamicAnalysis::getNbLogicOps)
     .def("get_nb_comp_ops", &DynamicAnalysis::getNbCompOps)
-- 
GitLab