Skip to content

Commit e156791

Browse files
Arm backend: Allow graph_module to be None in get_node_debug_info
get_node_debug_info() without graph_module will now only print the node information. Change-Id: I12d9cc30eafc9c1fadfb50dccaf39fc3b4b5663b Signed-off-by: Sebastian Larsson <[email protected]>
1 parent 3600d4f commit e156791

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

backends/arm/tosa_utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,13 @@ def dbg_node(node: torch.fx.Node, graph_module: torch.fx.GraphModule):
3030
logger.info(get_node_debug_info(node, graph_module))
3131

3232

33-
def get_node_debug_info(node: torch.fx.Node, graph_module: torch.fx.GraphModule) -> str:
33+
def get_node_debug_info(
34+
node: torch.fx.Node, graph_module: torch.fx.GraphModule | None = None
35+
) -> str:
3436
output = (
3537
f" {inspect_node(graph=graph_module.graph, node=node)}\n"
38+
if graph_module
39+
else ""
3640
"-- NODE DEBUG INFO --\n"
3741
f" Op is {node.op}\n"
3842
f" Name is {node.name}\n"

0 commit comments

Comments
 (0)