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

Function pretty_print_stacktraces

exir/print_program.py:307–317  ·  view source on GitHub ↗

Pretty prints the traceback for one instruction

(obj: FrameList)

Source from the content-addressed store, hash-verified

305
306
307def pretty_print_stacktraces(obj: FrameList) -> str:
308 """
309 Pretty prints the traceback for one instruction
310 """
311 pretty = "Traceback (most recent call last): \n"
312 for frame in obj.items:
313 pretty += f' File "{frame.filename}", '
314 pretty += f"line {str(frame.lineno)}, in {frame.name}\n"
315 pretty += f"{frame.context} \n"
316 pretty += "\n"
317 return pretty
318
319
320def add_cursor_to_graph(graph: torch.fx.Graph, finding_node: torch.fx.Node) -> str:

Callers 1

inspect_nodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected