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

Function get_node_debug_info

backends/arm/common/debug.py:23–51  ·  view source on GitHub ↗
(
    node: torch.fx.Node, graph_module: torch.fx.GraphModule | None = None
)

Source from the content-addressed store, hash-verified

21
22
23def get_node_debug_info(
24 node: torch.fx.Node, graph_module: torch.fx.GraphModule | None = None
25) -> str:
26 output = (
27 f" {inspect_node(graph=graph_module.graph, node=node)}\n"
28 if graph_module
29 else ""
30 "-- NODE DEBUG INFO --\n"
31 f" Op is {node.op}\n"
32 f" Name is {node.name}\n"
33 f" Node target is {node.target}\n"
34 f" Node args is {node.args}\n"
35 f" Node kwargs is {node.kwargs}\n"
36 f" Node users is {node.users}\n"
37 " Node.meta = \n"
38 )
39 for k, v in node.meta.items():
40 if k == "stack_trace":
41 matches = v.split("\n")
42 output += " 'stack_trace =\n"
43 for m in matches:
44 output += f" {m}\n"
45 else:
46 output += f" '{k}' = {v}\n"
47
48 if isinstance(v, list):
49 for i in v:
50 output += f" {i}\n"
51 return output
52
53
54# Output TOSA flatbuffer for debugging

Callers 4

get_first_fake_tensorFunction · 0.90
callMethod · 0.90
_is_ok_for_quantizationFunction · 0.90
debug_nodeFunction · 0.85

Calls 3

inspect_nodeFunction · 0.90
itemsMethod · 0.80
splitMethod · 0.80

Tested by

no test coverage detected