tf.keras.ops.argpartition
Stay organized with collections
Save and categorize content based on your preferences.
Performs an indirect partition along the given axis.
tf.keras.ops.argpartition(
x, kth, axis=-1
)
It returns an array
of indices of the same shape as x that index data along the given axis
in partitioned order.
Args |
x
|
Array to sort.
|
kth
|
Element index to partition by.
The k-th element will be in its final sorted position and all
smaller elements will be moved before it and all larger elements
behind it. The order of all elements in the partitions is undefined.
If provided with a sequence of k-th it will partition all of them
into their sorted position at once.
|
axis
|
Axis along which to sort. The default is -1 (the last axis).
If None, the flattened array is used.
|
Returns |
Array of indices that partition x along the specified axis.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2026-10-31 UTC.
[null,null,["Last updated 2026-10-31 UTC."],[],[]]