Skip to content

Commit 05f6985

Browse files
ArmavicaricardoV94
authored andcommitted
Remove npy<2 compatibility for numpy_maxdims
1 parent 27f91ba commit 05f6985

File tree

2 files changed

+1
-5
lines changed

2 files changed

+1
-5
lines changed

pytensor/npy_2_compat.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@
2424
numpy_axis_is_none_flag = 32
2525

2626

27-
# max number of dims is 64 in numpy 2.x; 32 in older versions
28-
numpy_maxdims = 64 if using_numpy_2 else 32
29-
30-
3127
# function that replicates np.unique from numpy < 2.0
3228
def old_np_unique(
3329
arr, return_index=False, return_inverse=False, return_counts=False, axis=None

tests/tensor/test_elemwise.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
from pytensor.graph.replace import vectorize_node
2020
from pytensor.link.basic import PerformLinker
2121
from pytensor.link.c.basic import CLinker, OpWiseCLinker
22-
from pytensor.npy_2_compat import numpy_maxdims
2322
from pytensor.scalar import ScalarOp, float32, float64, int32, int64
2423
from pytensor.tensor import as_tensor_variable
2524
from pytensor.tensor.basic import get_scalar_constant_value, second
@@ -168,6 +167,7 @@ def test_infer_shape(self):
168167
)
169168

170169
def test_too_big_rank(self):
170+
numpy_maxdims = 64
171171
x = self.type(self.dtype, shape=())()
172172
y = x.dimshuffle(("x",) * (numpy_maxdims + 1))
173173

0 commit comments

Comments
 (0)