[Feature]: Batched argmax reduction operator
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 1
- Forks
- 10
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 1
Description
Add a batched operator that returns, per row along a configurable axis, the index of the maximum element and its value. This is the "best-class" reduction used everywhere in inference post-processing.
Use cases
- Detection: best class + score per anchor (
[B, N, C]→[B, N]), the input to top-k. - Classification: top-1 label + confidence.
- Segmentation: per-pixel class map (
[B, H, W, C]→[B, H, W]).
Requirements
- Input scores tensor with a configurable reduction axis (must handle the class axis in both
[B, N, C]and[B, C, N]layouts). - Output two tensors: argmax indices (integer) and corresponding values.
- Dtypes: fp32 inputs; integer index output.
- GPU and CPU paths, following the existing operator/kernel-wrapper pattern.
Acceptance
- Correct results vs a CPU golden model across shapes, axes, and both layouts.
- Ties resolved deterministically (e.g. lowest index wins) and documented.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No file or test is named. Start by locating existing operator and kernel-wrapper implementations, including both CPU and GPU paths, then identify the test structure used for shape and axis coverage. Done means matching a CPU golden model across the requested layouts and axes, returning indices and values, with deterministic tie handling documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- computer-vision
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100