From adf85efbbee73b722e49c55751f5b15bda411723 Mon Sep 17 00:00:00 2001 From: cmoineau <cyril.moineau@cea.fr> Date: Tue, 24 Oct 2023 09:41:42 +0000 Subject: [PATCH] Add getGraphview in scheduler. --- include/aidge/graph/GraphView.hpp | 12 ++++++------ include/aidge/graph/Node.hpp | 4 ++-- include/aidge/scheduler/Scheduler.hpp | 3 +++ python_binding/operator/pybind_Operator.cpp | 2 ++ 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/include/aidge/graph/GraphView.hpp b/include/aidge/graph/GraphView.hpp index 89ba14849..bcd5f774b 100644 --- a/include/aidge/graph/GraphView.hpp +++ b/include/aidge/graph/GraphView.hpp @@ -322,17 +322,17 @@ public: /** * @brief Insert a node (newParentNode) as a parent of the passed node (childNode). - * + * * @param childNode Node that gets a new parent. * @param newParentNode Inserted Node. * @param childInputTensorIdx Index of the input Tensor for the childNode linked to the inserted Node output. * @param newParentInputTensorIdx Index of the input Tensor for the newParentNode linked to the former parent of childNode. * @param newParentOutputTensorIdx Index of the output Tensor for the newParentNode linked to the childNode's input Tensor. */ - void insertParent(NodePtr childNode, - NodePtr newParentNode, - IOIndex_t childInputTensorIdx, - IOIndex_t newParentInputTensorIdx, + void insertParent(NodePtr childNode, + NodePtr newParentNode, + IOIndex_t childInputTensorIdx, + IOIndex_t newParentInputTensorIdx, IOIndex_t newParentOutputTensorIdx); /** @@ -421,4 +421,4 @@ private: }; } // namespace Aidge -#endif /* AIDGE_CORE_GRAPH_GRAPHVIEW_H_ */ \ No newline at end of file +#endif /* AIDGE_CORE_GRAPH_GRAPHVIEW_H_ */ diff --git a/include/aidge/graph/Node.hpp b/include/aidge/graph/Node.hpp index 1d8449ac2..bf8e9727d 100644 --- a/include/aidge/graph/Node.hpp +++ b/include/aidge/graph/Node.hpp @@ -187,7 +187,7 @@ public: IOIndex_t getNbFreeDataInputs() const; /** - * @brief List input ids of children liked to outputs of the node + * @brief List input ids of children linked to outputs of the node * @return std::vector<std::vector<std::pair<std::shared_ptr<Node>, * IOIndex_t>>> */ @@ -402,7 +402,7 @@ public: /** * @brief Get the set of pointers to connected node at a distance of a delta. - * @details the recution are cut + * @details the recution are cut * Return a nullptr is nofing found. * @param delta Input delta. * @return std::shared_ptr<Node> diff --git a/include/aidge/scheduler/Scheduler.hpp b/include/aidge/scheduler/Scheduler.hpp index 1896894ee..faf6c49bd 100644 --- a/include/aidge/scheduler/Scheduler.hpp +++ b/include/aidge/scheduler/Scheduler.hpp @@ -64,6 +64,9 @@ public: std::vector<std::shared_ptr<Node>> getStaticScheduling(){ return mStaticSchedule; } + std::shared_ptr<GraphView> getGraphView(){ + return mGraphView; + } private: /** diff --git a/python_binding/operator/pybind_Operator.cpp b/python_binding/operator/pybind_Operator.cpp index 6b535e8cf..3d18fa3b9 100644 --- a/python_binding/operator/pybind_Operator.cpp +++ b/python_binding/operator/pybind_Operator.cpp @@ -20,7 +20,9 @@ void init_Operator(py::module& m){ py::class_<Operator, std::shared_ptr<Operator>>(m, "Operator") .def("output", &Operator::output, py::arg("outputIdx")) .def("input", &Operator::input, py::arg("inputIdx")) + .def("nb_inputs", &Operator::nbInputs) .def("nb_data_inputs", &Operator::nbDataInputs) + .def("nb_outputs", &Operator::nbOutputs) .def("associate_input", &Operator::associateInput, py::arg("inputIdx"), py::arg("data")) .def("set_datatype", &Operator::setDatatype, py::arg("datatype")) .def("set_backend", &Operator::setBackend, py::arg("name")) -- GitLab