Skip to content
Snippets Groups Projects
Commit 2c94e087 authored by Octave Perrin's avatar Octave Perrin
Browse files

more pybind

parent ddfd001a
No related branches found
No related tags found
1 merge request!245aidge_core#194: Add documentation for GraphView
......@@ -416,7 +416,7 @@ public:
* Get the nodes name according to the GraphView nodes ranking.
* @param format The formatting string to be used with fmt::format().
* @details The usable positional arguments are the following:
* {0} node name, {1} node type, {2} rank, {3} type rank
* {0} node name, {1} node type, {2} rank, {3} type rankf
* @param markNonUnicity If true, non unique ranking is prefixed with "?"
* @return std::map<NodePtr, std::string> A map with the corresponding names
*/
......
......@@ -180,7 +180,15 @@ void init_GraphView(py::module& m) {
.def("set_backend", &GraphView::setBackend, py::arg("backend"), py::arg("device") = 0)
.def("get_ordered_nodes", &GraphView::getOrderedNodes, py::arg("reversed") = false,
R"mydelimiter(
Get ordered nodes for the graph view
Get a topological node order for an acyclic walk of the graph.
Graph cycles are broken on operator back edges such that resolution on
single level lattice can be done in a single pass as it is
the case generally for static resolution of Tensor shapes/datatypes.
:param reversed: if True, returns a topological order of the reversed graph
:type reversed: bool
:return: the ordered list of nodes
:rtype: List[Node]
)mydelimiter")
// .def("__getitem__", [](Tensor& b, size_t idx)-> py::object {
// // TODO : Should return error if backend not compatible with get
......@@ -218,20 +226,18 @@ void init_GraphView(py::module& m) {
.def("get_ranked_nodes_name", &GraphView::getRankedNodesName, py::arg("format"), py::arg("mark_non_unicity") = true,
R"mydelimiter(
//TODO
Get the nodes name according to the GraphView nodes ranking.
@param format The formatting string to be used with fmt::format().
@details The usable positional arguments are the following:
{0} node name, {1} node type, {2} rank, {3} type rank
@param markNonUnicity If true, non unique ranking is prefixed with "?"
@return std::map<NodePtr, std::string> A map with the corresponding names
*/
Get the nodes name according to the GraphView nodes ranking.
:param format: The formatting string to be used in the output f-string
The usable positional arguments are the following:
{0} node name, {1} node type, {2} rank, {3} type rank
:type format: string
:param markNonUnicity: If true, non unique ranking is prefixed with "?"
:type markNonUnicity: bool
:return: map(Node, string) A map with the corresponding names
)mydelimiter")
.def("set_dataformat", &GraphView::setDataFormat, py::arg("dataformat"))
;
.def("set_dataformat", &GraphView::setDataFormat, py::arg("dataformat"));
m.def("get_connected_graph_view", &getConnectedGraphView,
R"mydelimiter(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment