diff --git a/python_binding/operator/pybind_WeightInterleaving.cpp b/python_binding/operator/pybind_WeightInterleaving.cpp new file mode 100644 index 0000000000000000000000000000000000000000..25b423bd66503b39f031695121cf673c45c34bbe --- /dev/null +++ b/python_binding/operator/pybind_WeightInterleaving.cpp @@ -0,0 +1,39 @@ +/******************************************************************************** + * 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 <pybind11/pybind11.h> +#include "aidge/operator/WeightInterleaving.hpp" + +namespace py = pybind11; + +namespace Aidge { + +void declare_WeightInterleaving(py::module &m) { + py::class_<WeightInterleaving_Op, std::shared_ptr<WeightInterleaving_Op>, OperatorTensor>(m, "WeightInterleavingOp", py::multiple_inheritance()) + .def(py::init<>()) + .def_static("get_inputs_name", &WeightInterleaving_Op::getInputsName) + .def_static("get_outputs_name", &WeightInterleaving_Op::getOutputsName) + .def_readonly_static("Type", &WeightInterleaving_Op::Type) + + .def("__repr__", [](WeightInterleaving_Op& b) { + return fmt::format("Operator(type='{}')", b.Type); + }); + + declare_registrable<WeightInterleaving_Op>(m, "WeightInterleavingOp"); + + m.def("WeightInterleaving", &WeightInterleaving, py::arg("name") = ""); +} + +void init_WeightInterleaving(py::module &m) { + declare_WeightInterleaving(m); +} + +} // namespace Aidge diff --git a/python_binding/pybind_core.cpp b/python_binding/pybind_core.cpp index 006eeb289f25570ddf337f048b05816102624028..f572c024d3cf69a1a06cd9be3e60cc7106fccfe3 100644 --- a/python_binding/pybind_core.cpp +++ b/python_binding/pybind_core.cpp @@ -83,6 +83,7 @@ void init_Sub(py::module&); void init_Tanh(py::module&); void init_Transpose(py::module&); void init_Unsqueeze(py::module&); +void init_WeightInterleaving(py::module&); void init_Node(py::module&); void init_GraphView(py::module&); @@ -177,6 +178,7 @@ void init_Aidge(py::module& m) { init_Tanh(m); init_Transpose(m); init_Unsqueeze(m); + init_WeightInterleaving(m); init_Producer(m);