@@ -288,6 +288,7 @@ def cumulative_sum(
288
288
* If `x` has a boolean data type, the returned array will
289
289
have the default signed integral type for the device
290
290
where input array `x` is allocated.
291
+
291
292
If the data type (either specified or resolved) differs from the
292
293
data type of `x`, the input array elements are cast to the
293
294
specified data type before computing the cumulative sum.
@@ -302,13 +303,16 @@ def cumulative_sum(
302
303
an array containing cumulative sums. The returned array has the data
303
304
type as described in the `dtype` parameter description above.
304
305
305
- Where `N` is the size of the axis the cumulative sums are computed
306
- along, the returned array shape is determined as follows.
307
- * If `include_initial` is `False`, the returned array will have the
308
- same shape as `x`.
309
- * If `include_initial` is `True`, the returned array will have the
310
- same shape as `x` except the axis along which the cumulative sum is
311
- calculated, which will have size `N+1`.
306
+ The returned array shape is determined as follows:
307
+
308
+ * If `include_initial` is `False`, the returned array will
309
+ have the same shape as `x`
310
+ * If `include_initial` is `True`, the returned array will
311
+ have the same shape as `x` except the axis along which the
312
+ cumulative sum is calculated, which will have size `N+1`
313
+
314
+ where `N` is the size of the axis the cumulative sums are computed
315
+ along.
312
316
"""
313
317
return _accumulate_common (
314
318
x ,
@@ -355,27 +359,32 @@ def cumulative_prod(
355
359
* If `x` has a boolean data type, the returned array will
356
360
have the default signed integral type for the device
357
361
where input array `x` is allocated.
362
+
358
363
If the data type (either specified or resolved) differs from the
359
364
data type of `x`, the input array elements are cast to the
360
365
specified data type before computing the cumulative product.
361
366
Default: `None`.
362
367
include_initial (bool):
363
368
boolean indicating whether to include the initial value (i.e., the
364
- additive identity, zero) as the first value along the provided axis
365
- in the output. Default: `False`.
369
+ additive identity, zero) as the first value along the provided
370
+ axis in the output. Default: `False`.
366
371
367
372
Returns:
368
373
usm_ndarray:
369
- an array containing cumulative products. The returned array has the
370
- data type as described in the `dtype` parameter description above.
371
-
372
- Where `N` is the size of the axis the cumulative products are
373
- computed along, the returned array shape is determined as follows.
374
- * If `include_initial` is `False`, the returned array will have the
375
- same shape as `x`.
376
- * If `include_initial` is `True`, the returned array will have the
377
- same shape as `x` except the axis along which the cumulative product
378
- is calculated, which will have size `N+1`.
374
+ an array containing cumulative products. The returned array has
375
+ the data type as described in the `dtype` parameter description
376
+ above.
377
+
378
+ The returned array shape is determined as follows:
379
+
380
+ * If `include_initial` is `False`, the returned array will
381
+ have the same shape as `x`
382
+ * If `include_initial` is `True`, the returned array will
383
+ have the same shape as `x` except the axis along which the
384
+ cumulative product is calculated, which will have size `N+1`
385
+
386
+ where `N` is the size of the axis the cumulative products are
387
+ computed along.
379
388
"""
380
389
return _accumulate_common (
381
390
x ,
@@ -422,6 +431,7 @@ def cumulative_logsumexp(
422
431
* If `x` has a boolean data type, the returned array will
423
432
have the default signed integral type for the device
424
433
where input array `x` is allocated.
434
+
425
435
If the data type (either specified or resolved) differs from the
426
436
data type of `x`, the input array elements are cast to the
427
437
specified data type before computing the cumulative logsumexp.
@@ -433,18 +443,18 @@ def cumulative_logsumexp(
433
443
434
444
Returns:
435
445
usm_ndarray:
436
- an array containing cumulative logsumexp results. The returned array
437
- has the data type as described in the `dtype` parameter description
438
- above.
439
-
440
- Where `N` is the size of the axis the cumulative logsumexp results
441
- are computed along, the returned array shape is determined as
442
- follows.
443
- * If `include_initial` is `False`, the returned array will have the
444
- same shape as `x`.
445
- * If `include_initial` is `True`, the returned array will have the
446
- same shape as `x` except the axis along which the cumulative
447
- logsumexp is calculated, which will have size `N+1`.
446
+ an array containing cumulative logsumexp results. The returned
447
+ array has the data type as described in the `dtype` parameter
448
+ description above.
449
+
450
+ The returned array shape is determined as follows:
451
+
452
+ * If `include_initial` is `False`, the returned array will
453
+ have the same shape as `x`
454
+ * If `include_initial` is `True`, the returned array will
455
+ have the same shape as `x` except the axis along which the
456
+ cumulative logsumexp is calculated, which will have size
457
+ `N+1`
448
458
"""
449
459
return _accumulate_common (
450
460
x ,
0 commit comments