@@ -528,11 +528,6 @@ def partition(
528
528
The ordering of the elements in the two partitions on the either side of
529
529
the k-th element in the output array is undefined.
530
530
531
- Notes:
532
- If `xp` implements ``partition`` or an equivalent function (e.g. ``topk`` for torch),
533
- complexity will likely be O(n).
534
- If not, this function simply calls ``xp.sort`` and complexity is O(n log n).
535
-
536
531
Parameters
537
532
----------
538
533
a : Array
@@ -549,6 +544,12 @@ def partition(
549
544
-------
550
545
partitioned_array
551
546
Array of the same type and shape as `a`.
547
+
548
+ Notes
549
+ -----
550
+ If `xp` implements ``partition`` or an equivalent function
551
+ (e.g. ``topk`` for torch), complexity will likely be O(n).
552
+ If not, this function simply calls ``xp.sort`` and complexity is O(n log n).
552
553
"""
553
554
# Validate inputs.
554
555
if xp is None :
@@ -620,11 +621,6 @@ def argpartition(
620
621
It returns an array of indices of the same shape as `a` that
621
622
index data along the given axis in partitioned order.
622
623
623
- Notes:
624
- If `xp` implements `argpartition` or an equivalent method (e.g. topk for torch),
625
- complexity will likely be O(n).
626
- If not, this function simply calls `xp.argsort` and complexity is O(n log n).
627
-
628
624
Parameters
629
625
----------
630
626
a : Array
@@ -641,6 +637,12 @@ def argpartition(
641
637
-------
642
638
index_array
643
639
Array of indices that partition `a` along the specified axis.
640
+
641
+ Notes
642
+ -----
643
+ If `xp` implements ``argpartition`` or an equivalent function
644
+ e.g. ``topk`` for torch), complexity will likely be O(n).
645
+ If not, this function simply calls ``xp.argsort`` and complexity is O(n log n).
644
646
"""
645
647
# Validate inputs.
646
648
if xp is None :
0 commit comments