Skip to content

Feature request: Allow np.argmax to output top K maximum values #15128

Description

@regstrtn

Currently np.argmax, np.argmin, np.max and np.min return the maximum and minimum values respectively.
numpy.argmax(a, axis=None, out=None)
Often times we need to get the topKmax or topKmin values, mostly in the case of machine learning workloads where you need top K classes for a given input.
Requesting support for these scenarios in numpy. This scenario could be supported by np.max (and other functions), or there could be a separate family of methods np.maxK, minK etc?

Metadata

Metadata

Assignees

No one assigned

    Labels

    01 - Enhancement62 - Python APIChanges or additions to the Python API. Mailing list should usually be notified.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions