Skip to content

Commit 07bd48d

Browse files
committed
Conditionally disable caching of to_tuple helper due to failure in Python 3.10
1 parent c715295 commit 07bd48d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pytensor/link/numba/dispatch/blockwise.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import sys
12
from typing import cast
23

34
from numba.core.extending import overload
@@ -60,7 +61,10 @@ def numba_funcify_Blockwise(op: BlockwiseWithCoreShape, node, **kwargs):
6061
src,
6162
"to_tuple",
6263
global_env={"to_fixed_tuple": to_fixed_tuple},
63-
)
64+
),
65+
# cache=True leads to a numba.cloudpickle dump failure in Python 3.10
66+
# May be fine in Python 3.11, but I didn't test. It was fine in 3.12
67+
cache=sys.version_info >= (3, 12),
6468
)
6569

6670
def blockwise_wrapper(*inputs_and_core_shapes):

0 commit comments

Comments
 (0)