Skip to content

Commit 914e6e4

Browse files
committed
Check for compute_map in rval
1 parent 285e93e commit 914e6e4

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

pytensor/scan/op.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1500,10 +1500,6 @@ def make_thunk(self, node, storage_map, compute_map, no_recycling, impl=None):
15001500
node_input_storage = [storage_map[r] for r in node.inputs]
15011501
node_output_storage = [storage_map[r] for r in node.outputs]
15021502

1503-
# HACK: Here to handle Blockwise Scans
1504-
if compute_map is None:
1505-
compute_map = {out: [False] for out in node.outputs}
1506-
15071503
# Analyse the compile inner function to determine which inputs and
15081504
# outputs are on the gpu and speed up some checks during the execution
15091505
outs_is_tensor = [
@@ -1651,8 +1647,9 @@ def rval(
16511647
p=p, i=node_input_storage, o=node_output_storage, n=node, allow_gc=allow_gc
16521648
):
16531649
r = p(n, [x[0] for x in i], o)
1654-
for o in node.outputs:
1655-
compute_map[o][0] = True
1650+
if compute_map is not None:
1651+
for o in node.outputs:
1652+
compute_map[o][0] = True
16561653
if allow_gc:
16571654
self.fn.free()
16581655
return r

0 commit comments

Comments
 (0)