Skip to content

feature request: support argsort/argmax-style interface #45718

Open
@tmbdev

Description

@tmbdev

Julia currently supports 1D sortperm, and PR #45211 adds sortperm support for multidmensional arrays, returning CartesianIndex.

PyTorch and NumPy both provide multidimensional argsort functions that return sort indexes along only one dimension. While this is less general, it requires less storage in the return value for high dimensional arrays. Furthermore, there are CUDA kernels available for argsort but not for returning CartesianIndex. A similar comment applies to findmax vs NumPy argmax.

I would find it very useful if Julia could support argsort/argmax-style interfaces in addition to sortperm/findmax-style interfaces.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions