From bb6c36fa8d4fc9323f8cf3bd996e743ed11353f7 Mon Sep 17 00:00:00 2001
From: Olivier BICHLER <olivier.bichler@cea.fr>
Date: Tue, 18 Jun 2024 17:27:01 +0200
Subject: [PATCH] Added 1D Conv and Pad

---
 python_binding/operator/pybind_Conv.cpp           |  2 +-
 python_binding/operator/pybind_ConvDepthWise.cpp  |  2 +-
 .../operator/pybind_MetaOperatorDefs.cpp          |  4 ++--
 python_binding/operator/pybind_Pad.cpp            |  2 +-
 src/operator/Conv.cpp                             |  1 +
 src/operator/ConvDepthWise.cpp                    |  1 +
 src/operator/Pad.cpp                              | 15 +++++++++++++++
 7 files changed, 22 insertions(+), 5 deletions(-)
 create mode 100644 src/operator/Pad.cpp

diff --git a/python_binding/operator/pybind_Conv.cpp b/python_binding/operator/pybind_Conv.cpp
index d874e19b7..4a9f588be 100644
--- a/python_binding/operator/pybind_Conv.cpp
+++ b/python_binding/operator/pybind_Conv.cpp
@@ -73,7 +73,7 @@ template <DimIdx_t DIM> void declare_ConvOp(py::module &m) {
 
 
 void init_Conv(py::module &m) {
-//   declare_ConvOp<1>(m);
+  declare_ConvOp<1>(m);
   declare_ConvOp<2>(m);
 //   declare_ConvOp<3>(m);
 }
diff --git a/python_binding/operator/pybind_ConvDepthWise.cpp b/python_binding/operator/pybind_ConvDepthWise.cpp
index 4e63f3830..086df9364 100644
--- a/python_binding/operator/pybind_ConvDepthWise.cpp
+++ b/python_binding/operator/pybind_ConvDepthWise.cpp
@@ -65,7 +65,7 @@ template <DimIdx_t DIM> void declare_ConvDepthWiseOp(py::module &m) {
 
 
 void init_ConvDepthWise(py::module &m) {
-//   declare_ConvDepthWiseOp<1>(m);
+  declare_ConvDepthWiseOp<1>(m);
   declare_ConvDepthWiseOp<2>(m);
 //   declare_ConvDepthWiseOp<3>(m);
 
diff --git a/python_binding/operator/pybind_MetaOperatorDefs.cpp b/python_binding/operator/pybind_MetaOperatorDefs.cpp
index c8d88db79..d021a79c5 100644
--- a/python_binding/operator/pybind_MetaOperatorDefs.cpp
+++ b/python_binding/operator/pybind_MetaOperatorDefs.cpp
@@ -180,10 +180,10 @@ void declare_LSTMOp(py::module &m) {
 }
 
 void init_MetaOperatorDefs(py::module &m) {
-//   declare_PaddedConvOp<1>(m);
+  declare_PaddedConvOp<1>(m);
   declare_PaddedConvOp<2>(m);
 //   declare_PaddedConvOp<3>(m);
-//   declare_PaddedConvDepthWiseOp<1>(m);
+  declare_PaddedConvDepthWiseOp<1>(m);
   declare_PaddedConvDepthWiseOp<2>(m);
 //   declare_PaddedConvDepthWiseOp<3>(m);
 //   declare_PaddedAvgPoolingOp<1>(m);
diff --git a/python_binding/operator/pybind_Pad.cpp b/python_binding/operator/pybind_Pad.cpp
index 2bb635635..88d5fb461 100644
--- a/python_binding/operator/pybind_Pad.cpp
+++ b/python_binding/operator/pybind_Pad.cpp
@@ -63,6 +63,6 @@ void init_Pad(py::module &m) {
     .export_values();
   declare_PadOp<1>(m);
   declare_PadOp<2>(m);
-  declare_PadOp<3>(m);
+  //declare_PadOp<3>(m);
 }
 } // namespace Aidge
diff --git a/src/operator/Conv.cpp b/src/operator/Conv.cpp
index 24e39e481..1a849ede0 100644
--- a/src/operator/Conv.cpp
+++ b/src/operator/Conv.cpp
@@ -164,4 +164,5 @@ void Aidge::Conv_Op<DIM>::setBackend(const std::string &name, Aidge::DeviceIdx_t
     }
 }
 
+template class Aidge::Conv_Op<1>;
 template class Aidge::Conv_Op<2>;
\ No newline at end of file
diff --git a/src/operator/ConvDepthWise.cpp b/src/operator/ConvDepthWise.cpp
index 743ce80bc..41d386ef9 100644
--- a/src/operator/ConvDepthWise.cpp
+++ b/src/operator/ConvDepthWise.cpp
@@ -164,4 +164,5 @@ void Aidge::ConvDepthWise_Op<DIM>::setBackend(const std::string &name, Aidge::De
     }
 }
 
+template class Aidge::ConvDepthWise_Op<1>;
 template class Aidge::ConvDepthWise_Op<2>;
\ No newline at end of file
diff --git a/src/operator/Pad.cpp b/src/operator/Pad.cpp
new file mode 100644
index 000000000..8356b5da7
--- /dev/null
+++ b/src/operator/Pad.cpp
@@ -0,0 +1,15 @@
+/********************************************************************************
+ * Copyright (c) 2023 CEA-List
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Eclipse Public License 2.0 which is available at
+ * http://www.eclipse.org/legal/epl-2.0.
+ *
+ * SPDX-License-Identifier: EPL-2.0
+ *
+ ********************************************************************************/
+
+#include "aidge/operator/Pad.hpp"
+
+template class Aidge::Pad_Op<1>;
+template class Aidge::Pad_Op<2>;
-- 
GitLab