Skip to content

Commit affd3a5

Browse files
authored
Merge pull request #63 from tylerjereddy/treddy_numpy_2_axis_tuple
MAINT: NumPy normalize_axis_tuple
2 parents 5c82ea3 + 8117a4b commit affd3a5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

array_api_compat/common/_linalg.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@
55
from typing import Literal, Optional, Sequence, Tuple, Union
66
from ._typing import ndarray
77

8-
from numpy.core.numeric import normalize_axis_tuple
8+
import numpy as np
9+
if np.__version__[0] == "2":
10+
from numpy.lib.array_utils import normalize_axis_tuple
11+
else:
12+
from numpy.core.numeric import normalize_axis_tuple
913

1014
from ._aliases import matmul, matrix_transpose, tensordot, vecdot
1115
from .._internal import get_xp

0 commit comments

Comments
 (0)