diff --git a/python_binding/data/pybind_Spikegen.cpp b/python_binding/data/pybind_Spikegen.cpp new file mode 100644 index 0000000000000000000000000000000000000000..de4636bb29719741e43d14346fa57465caddd63a --- /dev/null +++ b/python_binding/data/pybind_Spikegen.cpp @@ -0,0 +1,26 @@ +/******************************************************************************** + * Copyright (c) 2025 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/Spikegen.hpp" +#include "aidge/data/Tensor.hpp" + +namespace py = pybind11; +namespace Aidge { + +void init_Spikegen(py::module &m) { + m.def("spikegen_rate", &spikegenRate, + py::arg("tensor"), py::arg("numSteps"), + "Performs spike rate encoding on a Tensor"); +} + +} // namespace Aidge diff --git a/python_binding/pybind_core.cpp b/python_binding/pybind_core.cpp index ef1111b39a2f6fff3153dfb7441543ff5c3956c2..e9e246ad1d663901ff8c02ea2d8f744fdbf90e3b 100644 --- a/python_binding/pybind_core.cpp +++ b/python_binding/pybind_core.cpp @@ -32,8 +32,10 @@ void init_OperatorImpl(py::module&); void init_Log(py::module&); void init_Operator(py::module&); void init_OperatorTensor(py::module&); +void init_Spikegen(py::module&); void init_StaticAnalysis(py::module&); + void init_Abs(py::module&); void init_Add(py::module&); void init_And(py::module&); @@ -122,6 +124,7 @@ void init_Aidge(py::module& m) { init_Tensor(m); init_TensorImpl(m); init_Attributes(m); + init_Spikegen(m); init_Node(m); init_GraphView(m);