@@ -56,23 +56,24 @@ def top_k(x, k, /, *, axis=None, mode="largest"):
56
56
over the flattened array. Default: ``None``.
57
57
mode (Literal["largest", "smallest"]):
58
58
search mode. Must be one of the following modes:
59
- - `"largest"`: return the `k` largest elements.
60
- - `"smallest"`: return the `k` smallest elements.
59
+
60
+ - `"largest"`: return the `k` largest elements.
61
+ - `"smallest"`: return the `k` smallest elements.
62
+
61
63
Default: `"largest"`.
62
64
63
65
Returns:
64
- tuple[usm_ndarray, usm_ndarray]:
66
+ tuple[usm_ndarray, usm_ndarray]
65
67
a namedtuple `(values, indices)` whose
66
68
67
- - first element `values` will be an array containing the `k` largest or
68
- smallest elements of `x`. The array has the same data type as `x`.
69
- If `axis` was `None`, `values` will be a one-dimensional array
70
- with shape `(k,)` and otherwise, `values` will have shape
71
- `x.shape[:axis] + (k,) + x.shape[axis+1:]`
72
-
73
- - second element `indices` will be an array containing indices of `x`
74
- that result in `values`. The array will have the same shape as
75
- `values` and will have the default array index data type.
69
+ * first element `values` will be an array containing the `k`
70
+ largest or smallest elements of `x`. The array has the same data
71
+ type as `x`. If `axis` was `None`, `values` will be a
72
+ one-dimensional array with shape `(k,)` and otherwise, `values`
73
+ will have shape `x.shape[:axis] + (k,) + x.shape[axis+1:]`
74
+ * second element `indices` will be an array containing indices of
75
+ `x` that result in `values`. The array will have the same shape
76
+ as `values` and will have the default array index data type.
76
77
"""
77
78
largest = _get_top_k_largest (mode )
78
79
if not isinstance (x , dpt .usm_ndarray ):
0 commit comments