🌐 AI搜索 & 代理 主页
Skip to content

Conversation

@carlosgmartin
Copy link
Contributor

Let axis=-1 by default in take_along_axis to match NumPy.

This change happened in NumPy 2.3.0, as stated here:

The parameter axis in numpy.take_along_axis function has now a default value of -1. (gh-28615)

@jakevdp
Copy link
Collaborator

jakevdp commented Aug 13, 2025

Looks good - could you add a test? Just a one-off test somewhere around here that asserts that not passing axis returns the same results as passing axis=-1 explicitly. Thanks!

@carlosgmartin carlosgmartin force-pushed the take_along_axis_default_axis branch from 865a0c0 to fd38966 Compare August 13, 2025 18:30
@carlosgmartin
Copy link
Contributor Author

@jakevdp Done.

Copy link
Collaborator

@jakevdp jakevdp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@google-ml-butler google-ml-butler bot added kokoro:force-run pull ready Ready for copybara import and testing labels Aug 13, 2025
@copybara-service copybara-service bot merged commit 2432fcb into jax-ml:main Aug 13, 2025
22 checks passed
@carlosgmartin carlosgmartin deleted the take_along_axis_default_axis branch August 14, 2025 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kokoro:force-run pull ready Ready for copybara import and testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants