dev(opgraph): add facilities to OPGraph

- allow to construct graph from an existing networkx MultiDiGraph
- add a function to remove nodes unreachable from the outputs of the graph
- return the evaluated output when calling the OPGraph
This commit is contained in:
Arthur Meyre
2021-08-16 12:31:07 +02:00
parent 4976855c1d
commit 0eebbfcd26
2 changed files with 88 additions and 14 deletions

View File

@@ -139,6 +139,6 @@ def trace_numpy_function(
if isinstance(output_tracers, NPTracer):
output_tracers = (output_tracers,)
op_graph = OPGraph(output_tracers)
op_graph = OPGraph.from_output_tracers(output_tracers)
return op_graph