(graph: torch.fx.Graph, offending_node_idx: int)
| 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 |
no outgoing calls
no test coverage detected