Skip to content

Commit e7ac55b

Browse files
committed
Move from numpy.linalg import * to the top of the file
Otherwise the wrappers in the file do not override the NumPy definitions.
1 parent 172bb57 commit e7ac55b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

numpy_array_api_compat/linalg.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
import numpy as np
99
from numpy.core.numeric import normalize_axis_tuple
1010

11+
from numpy.linalg import *
12+
from numpy.linalg import __all__ as linalg_all
13+
14+
# These are in the main NumPy namespace but not in numpy.linalg
15+
from numpy import cross, diagonal, matmul, outer, tensordot, trace
16+
1117
class EighResult(NamedTuple):
1218
eigenvalues: ndarray
1319
eigenvectors: ndarray
@@ -104,12 +110,6 @@ def vector_norm(x: ndarray, /, *, axis: Optional[Union[int, Tuple[int, ...]]] =
104110

105111
return res
106112

107-
from numpy.linalg import *
108-
from numpy.linalg import __all__ as linalg_all
109-
110-
# These are in the main NumPy namespace but not in numpy.linalg
111-
from numpy import cross, diagonal, matmul, outer, tensordot, trace
112-
113113
__all__ = linalg_all.copy()
114114
__all__ += ['cross', 'diagonal', 'matmul', 'matrix_norm', 'matrix_transpose',
115115
'outer', 'svdvals', 'tensordot', 'trace', 'vecdot', 'vector_norm',

0 commit comments

Comments
 (0)