From 59f0667075316fb20874e8cb69f5941245e72803 Mon Sep 17 00:00:00 2001
From: hrouis <houssemeddine.rouis92@gmail.com>
Date: Tue, 6 Aug 2024 17:35:24 +0200
Subject: [PATCH] add default values for axes argument

---
 include/aidge/operator/ReduceMean.hpp         | 2 +-
 include/aidge/operator/ReduceSum.hpp          | 2 +-
 python_binding/operator/pybind_ReduceMean.cpp | 2 +-
 python_binding/operator/pybind_ReduceSum.cpp  | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/aidge/operator/ReduceMean.hpp b/include/aidge/operator/ReduceMean.hpp
index 000607c60..686ffd86c 100644
--- a/include/aidge/operator/ReduceMean.hpp
+++ b/include/aidge/operator/ReduceMean.hpp
@@ -101,7 +101,7 @@ public:
  * @param name Name of the Operator.
  * @return std::shared_ptr<Node> Node containing the Operator.
  */
-inline std::shared_ptr<Node> ReduceMean(const std::vector<std::int32_t> &axes,
+inline std::shared_ptr<Node> ReduceMean(const std::vector<std::int32_t> &axes={},
                                         DimSize_t keep_dims=1,
                                         const std::string& name = "") {
     // FIXME: properly handle default w&b initialization in every cases
diff --git a/include/aidge/operator/ReduceSum.hpp b/include/aidge/operator/ReduceSum.hpp
index db92da1d3..22aa01d11 100644
--- a/include/aidge/operator/ReduceSum.hpp
+++ b/include/aidge/operator/ReduceSum.hpp
@@ -101,7 +101,7 @@ public:
  * @param name Name of the Operator.
  * @return std::shared_ptr<Node> Node containing the Operator.
  */
-inline std::shared_ptr<Node> ReduceSum(const std::vector<std::int32_t> &axes,
+inline std::shared_ptr<Node> ReduceSum(const std::vector<std::int32_t> &axes={},
                                         DimSize_t keep_dims=1,
                                         const std::string& name = "") {
     // FIXME: properly handle default w&b initialization in every cases
diff --git a/python_binding/operator/pybind_ReduceMean.cpp b/python_binding/operator/pybind_ReduceMean.cpp
index 3023c077e..dae50b9af 100644
--- a/python_binding/operator/pybind_ReduceMean.cpp
+++ b/python_binding/operator/pybind_ReduceMean.cpp
@@ -40,7 +40,7 @@ void declare_ReduceMeanOp(py::module &m) {
         // AIDGE_ASSERT(axes.size() == DIM, "axes size [{}] does not match DIM [{}]", axes.size(), DIM);
 
         return ReduceMean(axes, keepDims, name);
-    }, py::arg("axes"),
+    }, py::arg("axes") = std::vector<std::int32_t>(),
        py::arg("keep_dims") = 1,
        py::arg("name") = "");
 }
diff --git a/python_binding/operator/pybind_ReduceSum.cpp b/python_binding/operator/pybind_ReduceSum.cpp
index 5521909ba..5a2c3eb1f 100644
--- a/python_binding/operator/pybind_ReduceSum.cpp
+++ b/python_binding/operator/pybind_ReduceSum.cpp
@@ -38,7 +38,7 @@ void init_ReduceSum(py::module &m) {
                         DimSize_t keepDims,
                         const std::string& name) {
         return ReduceSum(axes, keepDims, name);
-    }, py::arg("axes"),
+    }, py::arg("axes") = std::vector<std::int32_t>(),
        py::arg("keep_dims") = 1,
        py::arg("name") = "");
 }
-- 
GitLab