MCPcopy Create free account
hub / github.com/pytorch/executorch / _format_graph

Function _format_graph

exir/print_program.py:343–352  ·  view source on GitHub ↗
(graph: torch.fx.Graph, offending_node_idx: int)

Source from the content-addressed store, hash-verified

341
342 # This is heavily based on __str__ method of fx.Graph
343 def _format_graph(graph: torch.fx.Graph, offending_node_idx: int) -> str:
344 s = "graph():"
345 for ix, node in enumerate(graph.nodes):
346 node_str = node.format_node()
347 if node_str:
348 if ix != offending_node_idx:
349 s += "\n " + node_str
350 else:
351 s += "\n--> " + node_str
352 return s
353
354 return _format_graph(new_graph, found_at)
355

Callers 1

add_cursor_to_graphFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected