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 4753a08 commit 4f09fb7Copy full SHA for 4f09fb7
pytensor/scan/rewriting.py
@@ -1048,8 +1048,13 @@ def attempt_scan_inplace(
1048
return None
1049
1050
def apply(self, fgraph):
1051
+ scan_nodes = {node for node in fgraph.apply_nodes if isinstance(node.op, Scan)}
1052
+
1053
+ if not scan_nodes:
1054
+ return
1055
1056
for scan_idx, original_node in enumerate(reversed(fgraph.toposort())):
- if not isinstance(original_node.op, Scan):
1057
+ if original_node not in scan_nodes:
1058
continue
1059
1060
# First attempt to make the Scan compute inplace every recurrent
0 commit comments