pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/cupy/cupy/pull/9767

ts.com/assets/global-87aa887446e37f5c.css" /> Fix NumPy signature mismatch for cupy.argmax by Punit200320 · Pull Request #9767 · cupy/cupy · GitHub
Skip to content

Fix NumPy signature mismatch for cupy.argmax#9767

Open
Punit200320 wants to merge 4 commits intocupy:mainfrom
Punit200320:fix-numpy-signature
Open

Fix NumPy signature mismatch for cupy.argmax#9767
Punit200320 wants to merge 4 commits intocupy:mainfrom
Punit200320:fix-numpy-signature

Conversation

@Punit200320
Copy link

This PR fixes the function signature mismatch between NumPy and CuPy for cupy.argmax.

The dtype argument has been removed from the CuPy API to align with NumPy's signature:

numpy.argmax(a, axis=None, out=None, keepdims=False)

This improves API compatibility between NumPy and CuPy.

@Punit200320 Punit200320 requested a review from a team as a code owner March 4, 2026 11:31
@seberg
Copy link
Member

seberg commented Mar 5, 2026

Thanks for looking into this. I am confirming with others, but to me dtype= seems working and OK to keep around.
I would say we should change the scope slightly (sorry). That is modify the signature to something like: argmax(a, axis=None, _dtype=None, out=None, keepdims=False, dtype=None)
If _dtype is not None we then give a DeprecationWarning that in the Future out, keepdims, and dtype must be passed as keyword arguments.
(I.e. the future will be argmax(a, axis=None, *, out=None, keepdims=False, dtype=None) which differs from NumPy in the extra dtype and out being kwarg only, but I think both are fine.)

We also need to make sure to do two other things:

  1. If we modify argmax, we should make sure to modify argmin and the methods in core.pyx also aligned with identical changes (they may just be able to forward to a single warning).
  2. Any change should get some new tests to confirm it.

@seberg seberg added cat:enhancement Improvements to existing features st:awaiting-author Awaiting response from author labels Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cat:enhancement Improvements to existing features st:awaiting-author Awaiting response from author

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy