Skip to content

Commit 7b239bb

Browse files
Limit model graph nodes to named model variables
Some nodes such as `NoneConst` in an Aesara graph are named, but aren't model variables that the user is interested in.
1 parent 2161664 commit 7b239bb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pymc/model_graph.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,12 @@ def _expand(x):
4747
return reversed(x.owner.inputs)
4848
return []
4949

50-
parents = {get_var_name(x) for x in walk(nodes=var.owner.inputs, expand=_expand) if x.name}
50+
parents = {
51+
get_var_name(x)
52+
for x in walk(nodes=var.owner.inputs, expand=_expand)
53+
# Only consider nodes that are in the named model variables.
54+
if x.name and x.name in self._all_var_names
55+
}
5156

5257
return parents
5358

0 commit comments

Comments
 (0)