2
2
3
3
import warnings
4
4
5
- from ._lib import _compat , _utils
6
- from ._lib ._compat import array_namespace
7
- from ._lib ._typing import Array , ModuleType
5
+ from ._utils import _compat , _helpers
6
+ from ._utils ._compat import array_namespace
7
+ from ._utils ._typing import Array , ModuleType
8
8
9
9
__all__ = [
10
10
"atleast_nd" ,
@@ -136,7 +136,7 @@ def cov(m: Array, /, *, xp: ModuleType | None = None) -> Array:
136
136
m = atleast_nd (m , ndim = 2 , xp = xp )
137
137
m = xp .astype (m , dtype )
138
138
139
- avg = _utils .mean (m , axis = 1 , xp = xp )
139
+ avg = _helpers .mean (m , axis = 1 , xp = xp )
140
140
fact = m .shape [1 ] - 1
141
141
142
142
if fact <= 0 :
@@ -449,7 +449,7 @@ def setdiff1d(
449
449
else :
450
450
x1 = xp .unique_values (x1 )
451
451
x2 = xp .unique_values (x2 )
452
- return x1 [_utils .in1d (x1 , x2 , assume_unique = True , invert = True , xp = xp )]
452
+ return x1 [_helpers .in1d (x1 , x2 , assume_unique = True , invert = True , xp = xp )]
453
453
454
454
455
455
def sinc (x : Array , / , * , xp : ModuleType | None = None ) -> Array :
@@ -546,8 +546,8 @@ def pad(
546
546
pad_width : int ,
547
547
mode : str = "constant" ,
548
548
* ,
549
- xp : ModuleType | None = None ,
550
549
constant_values : bool | int | float | complex = 0 ,
550
+ xp : ModuleType | None = None ,
551
551
) -> Array :
552
552
"""
553
553
Pad the input array.
@@ -561,10 +561,10 @@ def pad(
561
561
mode : str, optional
562
562
Only "constant" mode is currently supported, which pads with
563
563
the value passed to `constant_values`.
564
- xp : array_namespace, optional
565
- The standard-compatible namespace for `x`. Default: infer.
566
564
constant_values : python scalar, optional
567
565
Use this value to pad the input. Default is zero.
566
+ xp : array_namespace, optional
567
+ The standard-compatible namespace for `x`. Default: infer.
568
568
569
569
Returns
570
570
-------
0 commit comments