Skip to content

Commit af698a7

Browse files
committed
Add option to print inner graphs in debugprint function
1 parent c822a8e commit af698a7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pytensor/printing.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ def debugprint(
101101
print_view_map: bool = False,
102102
print_memory_map: bool = False,
103103
print_fgraph_inputs: bool = False,
104+
print_inner_graphs: bool = True,
104105
) -> str | TextIO:
105106
r"""Print a graph as text.
106107
@@ -161,6 +162,8 @@ def debugprint(
161162
Whether to set both `print_destroy_map` and `print_view_map` to ``True``.
162163
print_fgraph_inputs
163164
Print the inputs of `FunctionGraph`\s.
165+
print_inner_graphs
166+
Whether to print the inner graphs of `Op`\s
164167
165168
Returns
166169
-------
@@ -322,7 +325,7 @@ def debugprint(
322325
print_view_map=print_view_map,
323326
)
324327

325-
if len(inner_graph_vars) > 0:
328+
if len(inner_graph_vars) > 0 and print_inner_graphs:
326329
print("", file=_file)
327330
prefix = ""
328331
new_prefix = prefix + " ← "

0 commit comments

Comments
 (0)