Skip to content

Commit d13a040

Browse files
authored
Fix test_bin_op in NumPy 2.0 (#5541)
`_set_promotion_state` is removed in NumPy 2.0. We just turn the contextmanager into a noop when the user has a newer NumPy version. I tested this locally. At some point we should add NumPy 2.0 support to CI, I guess.
1 parent f35eb5b commit d13a040

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

python/test/unit/language/test_core.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ def promotion_numpy_2_0():
5555
np._set_promotion_state(state)
5656

5757

58+
# No need to emulate NumPy 2.0 if the user has NumPy 2.0
59+
if np.__version__[0] != "1":
60+
promotion_numpy_2_0 = contextlib.nullcontext
61+
5862
# TODO: enable multiple cta cluster testing.
5963
# num_ctas_list = [1, 4] if torch.cuda.get_device_capability()[0] == 9 else [1]
6064
num_ctas_list = [1]

0 commit comments

Comments
 (0)