diff --git a/include/aidge/recipes/GraphViewHelper.hpp b/include/aidge/recipes/GraphViewHelper.hpp index 45928ee6326a6fb129b616070e72c75b5330203e..a2c571bf4ed164729f7c3416c814b913b4d07e6f 100644 --- a/include/aidge/recipes/GraphViewHelper.hpp +++ b/include/aidge/recipes/GraphViewHelper.hpp @@ -28,6 +28,8 @@ namespace Aidge { */ std::set<std::shared_ptr<Tensor>> producers(std::shared_ptr<GraphView> graphview); + +// TODO: change for every Tensor of Operator Producer not constant /** * @brief Getter for every ``Tensor`` owned by an ``Operator`` inside the provided ``GraphView``. * @note An ``Operator`` owns its output ``Tensor``s. diff --git a/python_binding/pybind_core.cpp b/python_binding/pybind_core.cpp index 5ffa8f6b460b720581fb8196d45ad84e1ef350f2..8f3e5880cd2fb8e8ecbee9c185ab6b476eb1f0e6 100644 --- a/python_binding/pybind_core.cpp +++ b/python_binding/pybind_core.cpp @@ -68,6 +68,7 @@ void init_GraphRegex(py::module&); void init_MatchSolution(py::module&); void init_Recipes(py::module&); +void init_GraphViewHelper(py::module&); void init_Scheduler(py::module&); void init_TensorUtils(py::module&); @@ -129,6 +130,7 @@ void init_Aidge(py::module& m) { init_MatchSolution(m); init_Recipes(m); + init_GraphViewHelper(m); init_Scheduler(m); init_TensorUtils(m); init_Filler(m); diff --git a/python_binding/recipes/pybind_GraphViewHelper.cpp b/python_binding/recipes/pybind_GraphViewHelper.cpp new file mode 100644 index 0000000000000000000000000000000000000000..ac56fb4b43eb5b0a737157ec9e64c6771a692816 --- /dev/null +++ b/python_binding/recipes/pybind_GraphViewHelper.cpp @@ -0,0 +1,28 @@ +/******************************************************************************** + * 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 <pybind11/stl.h> + +#include <memory> +#include <set> + +#include "aidge/graph/GraphView.hpp" +#include "aidge/data/Tensor.hpp" +#include "aidge/recipes/GraphViewHelper.hpp" + +namespace py = pybind11; + +namespace Aidge { +void init_GraphViewHelper(py::module &m) { + m.def("producers", &producers, py::arg("graphview")); +} +} // namespace Aidge