Skip to content

Commit 03e9fbd

Browse files
committed
Fix docstrings for sum, prod, logsumexp, and reduce_hypot
As pointed out by @vtavana
1 parent c2c4072 commit 03e9fbd

File tree

1 file changed

+10
-23
lines changed

1 file changed

+10
-23
lines changed

dpctl/tensor/_reduction.py

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -148,19 +148,15 @@ def sum(x, /, *, axis=None, dtype=None, keepdims=False):
148148
data type of the returned array. If `None`, the default data
149149
type is inferred from the "kind" of the input array data type.
150150
151-
* If `x` has a real-valued floating-point data type,
152-
the returned array will have the default real-valued
153-
floating-point data type for the device where input
154-
array `x` is allocated.
151+
* If `x` has a real- or complex-valued floating-point data
152+
type, the returned array will have the same data type as
153+
`x`.
155154
* If `x` has signed integral data type, the returned array
156155
will have the default signed integral type for the device
157156
where input array `x` is allocated.
158157
* If `x` has unsigned integral data type, the returned array
159158
will have the default unsigned integral type for the device
160159
where input array `x` is allocated.
161-
* If `x` has a complex-valued floating-point data type,
162-
the returned array will have the default complex-valued
163-
floating-pointer data type for the device where input
164160
array `x` is allocated.
165161
* If `x` has a boolean data type, the returned array will
166162
have the default signed integral type for the device
@@ -210,20 +206,15 @@ def prod(x, /, *, axis=None, dtype=None, keepdims=False):
210206
data type of the returned array. If `None`, the default data
211207
type is inferred from the "kind" of the input array data type.
212208
213-
* If `x` has a real-valued floating-point data type,
214-
the returned array will have the default real-valued
215-
floating-point data type for the device where input
216-
array `x` is allocated.
209+
* If `x` has a real- or complex-valued floating-point data
210+
type, the returned array will have the same data type as
211+
`x`.
217212
* If `x` has signed integral data type, the returned array
218213
will have the default signed integral type for the device
219214
where input array `x` is allocated.
220215
* If `x` has unsigned integral data type, the returned array
221216
will have the default unsigned integral type for the device
222217
where input array `x` is allocated.
223-
* If `x` has a complex-valued floating-point data type,
224-
the returned array will have the default complex-valued
225-
floating-pointer data type for the device where input
226-
array `x` is allocated.
227218
* If `x` has a boolean data type, the returned array will
228219
have the default signed integral type for the device
229220
where input array `x` is allocated.
@@ -273,10 +264,8 @@ def logsumexp(x, /, *, axis=None, dtype=None, keepdims=False):
273264
data type of the returned array. If `None`, the default data
274265
type is inferred from the "kind" of the input array data type.
275266
276-
* If `x` has a real-valued floating-point data type,
277-
the returned array will have the default real-valued
278-
floating-point data type for the device where input
279-
array `x` is allocated.
267+
* If `x` has a real-valued floating-point data type, the
268+
returned array will have the same data type as `x`.
280269
* If `x` has a boolean or integral data type, the returned array
281270
will have the default floating point data type for the device
282271
where input array `x` is allocated.
@@ -330,10 +319,8 @@ def reduce_hypot(x, /, *, axis=None, dtype=None, keepdims=False):
330319
data type of the returned array. If `None`, the default data
331320
type is inferred from the "kind" of the input array data type.
332321
333-
* If `x` has a real-valued floating-point data type,
334-
the returned array will have the default real-valued
335-
floating-point data type for the device where input
336-
array `x` is allocated.
322+
* If `x` has a real-valued floating-point data type, the
323+
returned array will have the same data type as `x`.
337324
* If `x` has a boolean or integral data type, the returned array
338325
will have the default floating point data type for the device
339326
where input array `x` is allocated.

0 commit comments

Comments
 (0)