We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b2b7e28 commit ec878f7Copy full SHA for ec878f7
pytensor/graph/basic.py
@@ -1088,13 +1088,18 @@ def truncated_graph_inputs(
1088
return truncated_inputs
1089
1090
blockers: Set[Variable] = set(ancestors_to_include)
1091
+ # variables that go here are under check already, do not repeat the loop for them
1092
+ seen: Set[Variable] = set()
1093
# enforce O(1) check for node in ancestors to include
1094
ancestors_to_include = blockers.copy()
1095
1096
while candidates:
1097
# on any new candidate
1098
node = candidates.pop()
-
1099
+ if node in seen:
1100
+ continue
1101
+ else:
1102
+ seen.add(node)
1103
# There was a repeated reference to this node, we have already investigated it
1104
if node in truncated_inputs:
1105
continue
0 commit comments