@@ -116,7 +116,7 @@ def cov(m: Array, /, *, xp: ModuleType) -> Array:
116
116
m = atleast_nd (m , ndim = 2 , xp = xp )
117
117
m = xp .astype (m , dtype )
118
118
119
- avg = mean (m , axis = 1 , xp = xp )
119
+ avg = _mean (m , axis = 1 , xp = xp )
120
120
fact = m .shape [1 ] - 1
121
121
122
122
if fact <= 0 :
@@ -133,7 +133,7 @@ def cov(m: Array, /, *, xp: ModuleType) -> Array:
133
133
return xp .squeeze (c , axis = axes )
134
134
135
135
136
- def mean (
136
+ def _mean (
137
137
x : Array ,
138
138
/ ,
139
139
* ,
@@ -142,44 +142,7 @@ def mean(
142
142
xp : ModuleType ,
143
143
) -> Array :
144
144
"""
145
- Calculates the arithmetic mean of the input array ``x``.
146
-
147
- In addition to the standard ``mean``, this function supports complex-valued input.
148
-
149
- Parameters
150
- ----------
151
- x: array
152
- input array. Should have a floating-point data type.
153
- axis: int or tuple of ints, optional
154
- axis or axes along which arithmetic means must be computed.
155
- By default, the mean must be computed over the entire array.
156
- If a tuple of integers, arithmetic means must be computed over multiple axes.
157
- Default: ``None``.
158
- keepdims: bool, optional
159
- if ``True``, the reduced axes (dimensions) must be included in the result as
160
- singleton dimensions, and, accordingly, the result must be compatible with
161
- the input array (see :ref:`broadcasting`).
162
- Otherwise, if ``False``, the reduced axes (dimensions) must not be included
163
- in the result. Default: ``False``.
164
-
165
- Returns
166
- -------
167
- out: array
168
- if the arithmetic mean was computed over the entire array,
169
- a zero-dimensional array containing the arithmetic mean;
170
- otherwise, a non-zero-dimensional array containing the arithmetic means.
171
- The returned array must have the same data type as ``x``.
172
-
173
- Notes
174
- -----
175
-
176
- **Special Cases**
177
-
178
- Let ``N`` equal the number of elements over which to compute the arithmetic mean.
179
-
180
- - If ``N`` is ``0``, the arithmetic mean is ``NaN``.
181
- - If ``x_i`` is ``NaN``, the arithmetic mean is ``NaN``
182
- (i.e., ``NaN`` values propagate).
145
+ Complex mean, https://github.com/data-apis/array-api/issues/846.
183
146
"""
184
147
if xp .isdtype (x .dtype , "complex floating" ):
185
148
x_real = xp .real (x )
0 commit comments