File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change 11from cupy .linalg import * # noqa: F403
2- # cupy.linalg doesn't have __all__. If it is added, replace this with
2+
3+ # https://github.com/cupy/cupy/issues/9749
4+ from cupy .linalg import lstsq # noqa: F401
5+
6+ # cupy.linalg doesn't have __all__ in cupy<14. If it is added, replace this with
37#
48# from cupy.linalg import __all__ as linalg_all
59_n : dict [str , object ] = {}
610exec ('from cupy.linalg import *' , _n )
711del _n ['__builtins__' ]
8- linalg_all = list (_n )
12+ linalg_all = list (_n ) + [ 'lstsq' ]
913del _n
1014
15+ try :
16+ # cupy 14 exports it, cupy 13 does not
17+ from cupy .linalg import annotations # noqa: F401
18+ linalg_all += ['annotations' ]
19+ except ImportError :
20+ pass
21+
22+
1123from ..common import _linalg
1224from .._internal import get_xp
1325
4355
4456__all__ = linalg_all + _linalg .__all__
4557
58+ # cupy 13 does not have __all__, cupy 14 has it: remove duplicates
59+ __all__ = sorted (list (set (__all__ )))
60+
4661def __dir__ () -> list [str ]:
4762 return __all__
You can’t perform that action at this time.
0 commit comments