7
7
from typing import cast
8
8
9
9
from . import _compat
10
- from ._compat import is_array_api_obj , is_numpy_array
10
+ from ._compat import array_namespace , is_array_api_obj , is_numpy_array
11
11
from ._typing import Array
12
12
13
- __all__ = ["in1d" , "mean" ]
13
+ __all__ = ["asarrays" , " in1d" , "is_python_scalar " , "mean" ]
14
14
15
15
16
16
def in1d (
@@ -33,7 +33,7 @@ def in1d(
33
33
https://github.com/numpy/numpy/blob/v1.26.0/numpy/lib/arraysetops.py#L524-L758
34
34
"""
35
35
if xp is None :
36
- xp = _compat . array_namespace (x1 , x2 )
36
+ xp = array_namespace (x1 , x2 )
37
37
38
38
# This code is run to make the code significantly faster
39
39
if x2 .shape [0 ] < 10 * x1 .shape [0 ] ** 0.145 :
@@ -84,7 +84,7 @@ def mean(
84
84
Complex mean, https://github.com/data-apis/array-api/issues/846.
85
85
"""
86
86
if xp is None :
87
- xp = _compat . array_namespace (x )
87
+ xp = array_namespace (x )
88
88
89
89
if xp .isdtype (x .dtype , "complex floating" ):
90
90
x_real = xp .real (x )
@@ -124,8 +124,8 @@ def asarrays(
124
124
----------
125
125
a, b : Array | int | float | complex | bool
126
126
Input arrays or scalars. At least one must be an array.
127
- xp : ModuleType
128
- The standard-compatible namespace for the returned arrays .
127
+ xp : array_namespace, optional
128
+ The standard-compatible namespace for `x`. Default: infer .
129
129
130
130
Returns
131
131
-------
0 commit comments