Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid using numpy.find_common_type #7651

Merged
merged 3 commits into from
Aug 17, 2023

Conversation

asi1024
Copy link
Member

@asi1024 asi1024 commented Jun 20, 2023

numpy.find_common_type has been deprecated in NumPy 1.25.


final_dtype = numpy.find_common_type(arraytypes, scalartypes)
final_dtype = numpy.result_type(*key)
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks, changes look good! This one, I suspect this is slightly more complicated because key can include slice objects. I am happy to also make a PR (was going to look into it later). The change I did in NumPy is here:

https://github.com/numpy/numpy/pull/22539/files#diff-8bea6cb955d7704ddbe7810c30cb214e48574730c1304ee17bdf09e61be40f8d

Copy link
Member

Choose a reason for hiding this comment

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

Thanks! We don't support slice objects here so it should be OK for now 😄

if isinstance(k, slice):
raise NotImplementedError

@asi1024 asi1024 added to-be-backported Pull-requests to be backported to stable branch cat:numpy-compat Follow the NumPy/SciPy spec changes prio:high labels Jun 21, 2023
@kmaehashi
Copy link
Member

/test mini

kmaehashi
kmaehashi previously approved these changes Aug 10, 2023
@kmaehashi
Copy link
Member

@asi1024 Could you check test failures? 🙏

@asi1024
Copy link
Member Author

asi1024 commented Aug 16, 2023

/test mini

@asi1024 asi1024 force-pushed the deprecate-find_common_types branch from f2b5351 to 9cc8dc2 Compare August 16, 2023 07:53
@asi1024
Copy link
Member Author

asi1024 commented Aug 16, 2023

/test mini

@asi1024
Copy link
Member Author

asi1024 commented Aug 17, 2023

@kmaehashi Ready to review!

@kmaehashi
Copy link
Member

Test failures are irrelevant.

@kmaehashi kmaehashi merged commit db0be4f into cupy:main Aug 17, 2023
45 of 47 checks passed
@kmaehashi kmaehashi added this to the v13.0.0rc1 milestone Aug 17, 2023
chainer-ci pushed a commit to chainer-ci/cupy that referenced this pull request Aug 17, 2023
@asi1024 asi1024 deleted the deprecate-find_common_types branch August 18, 2023 01:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cat:numpy-compat Follow the NumPy/SciPy spec changes prio:high to-be-backported Pull-requests to be backported to stable branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants