diff --git a/python_binding/operator/pybind_Stack.cpp b/python_binding/operator/pybind_Stack.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9bd429002b721d56a1901ae44b2203a01ece9759 --- /dev/null +++ b/python_binding/operator/pybind_Stack.cpp @@ -0,0 +1,29 @@ +/******************************************************************************** + * Copyright (c) 2024 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 <pybind11/pybind11.h> + +#include "aidge/data/Tensor.hpp" +#include "aidge/operator/Stack.hpp" +#include "aidge/operator/OperatorTensor.hpp" + +namespace py = pybind11; +namespace Aidge { +void init_Stack(py::module& m) { + py::class_<StackOp, std::shared_ptr<StackOp>, OperatorTensor>(m, "StackOp", py::multiple_inheritance()) + .def(py::init<const std::uint32_t>(), py::arg("max_elements")) + .def_static("get_inputs_name", &StackOp::getInputsName) + .def_static("get_outputs_name", &StackOp::getOutputsName) + .def_readonly_static("Type", &StackOp::s_type); + + m.def("Stack", &stack, py::arg("max_elements"), py::arg("name") = ""); +} +} diff --git a/python_binding/pybind_core.cpp b/python_binding/pybind_core.cpp index 7a88f61f518777e9b2e359f9c89eb1f3ebcd53d0..4f7ffea5fefe299a2670fd7bcb816c86070bf315 100644 --- a/python_binding/pybind_core.cpp +++ b/python_binding/pybind_core.cpp @@ -77,6 +77,7 @@ void init_Softmax(py::module&); void init_Split(py::module&); void init_Sqrt(py::module&); void init_Squeeze(py::module&); +void init_Stack(py::module&); void init_Sub(py::module&); void init_Tanh(py::module&); void init_Transpose(py::module&); @@ -169,6 +170,7 @@ void init_Aidge(py::module& m) { init_Split(m); init_Sqrt(m); init_Squeeze(m); + init_Stack(m); init_Sub(m); init_Tanh(m); init_Transpose(m);