Skip to content
Snippets Groups Projects
Commit 5b97a6a5 authored by Maxence Naud's avatar Maxence Naud
Browse files

[Upd] replace() python binding

parent 7299fadf
No related branches found
No related tags found
No related merge requests found
...@@ -26,7 +26,7 @@ void init_GraphView(py::module& m) { ...@@ -26,7 +26,7 @@ void init_GraphView(py::module& m) {
.def("save", &GraphView::save, py::arg("path"), py::arg("verbose") = false, .def("save", &GraphView::save, py::arg("path"), py::arg("verbose") = false,
R"mydelimiter( R"mydelimiter(
Save the GraphView as a Mermaid graph in a .md file at the specified location. Save the GraphView as a Mermaid graph in a .md file at the specified location.
:param path: save location :param path: save location
:type path: str :type path: str
)mydelimiter") )mydelimiter")
...@@ -34,14 +34,14 @@ void init_GraphView(py::module& m) { ...@@ -34,14 +34,14 @@ void init_GraphView(py::module& m) {
.def("get_output_nodes", &GraphView::outputNodes, .def("get_output_nodes", &GraphView::outputNodes,
R"mydelimiter( R"mydelimiter(
Get set of output Nodes. Get set of output Nodes.
:rtype: list[Node] :rtype: list[Node]
)mydelimiter") )mydelimiter")
.def("get_input_nodes", &GraphView::inputNodes, .def("get_input_nodes", &GraphView::inputNodes,
R"mydelimiter( R"mydelimiter(
Get set of input Nodes. Get set of input Nodes.
:rtype: list[Node] :rtype: list[Node]
)mydelimiter") )mydelimiter")
...@@ -49,7 +49,7 @@ void init_GraphView(py::module& m) { ...@@ -49,7 +49,7 @@ void init_GraphView(py::module& m) {
py::arg("other_node"), py::arg("include_learnable_parameters") = true, py::arg("other_node"), py::arg("include_learnable_parameters") = true,
R"mydelimiter( R"mydelimiter(
Include a Node to the current GraphView object. Include a Node to the current GraphView object.
:param other_node: Node to add :param other_node: Node to add
:type oth_Node: Node :type oth_Node: Node
:param includeLearnableParameter: include non-data inputs, like weights and biases. Default True. :param includeLearnableParameter: include non-data inputs, like weights and biases. Default True.
...@@ -66,18 +66,20 @@ void init_GraphView(py::module& m) { ...@@ -66,18 +66,20 @@ void init_GraphView(py::module& m) {
py::arg("fromTensor") = 0U, py::arg("toTensor") = gk_IODefaultIndex, py::arg("fromTensor") = 0U, py::arg("toTensor") = gk_IODefaultIndex,
R"mydelimiter( R"mydelimiter(
Include a Node to the current GraphView object. Include a Node to the current GraphView object.
:param other_node: Node to add :param other_node: Node to add
:type oth_Node: Node :type oth_Node: Node
:param includeLearnableParameter: include non-data inputs, like weights and biases. Default True. :param includeLearnableParameter: include non-data inputs, like weights and biases. Default True.
:type includeLearnableParameter :type includeLearnableParameter
)mydelimiter") )mydelimiter")
.def("replace_with", &GraphView::replaceWith, py::arg("new_nodes"), .def_static("replace", &GraphView::replace, py::args("old_nodes"), py::arg("new_nodes"),
R"mydelimiter( R"mydelimiter(
Replace the current GraphView with the set of given Nodes if possible. Replace the old set of Nodes with the new set of given Nodes if possible in every GraphView.
:param new_nodes: Nodes with connections already taken care of. :param old_nodes: Nodes actually connected in GraphViews.
:type old_nodes: Node
:param new_nodes: Nodes with inner connections already taken care of.
:type new_nodes: Node :type new_nodes: Node
:return: Whether any replacement has been made. :return: Whether any replacement has been made.
:rtype: bool :rtype: bool
......
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