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

min/max for complex inputs #67

Closed
ev-br opened this issue Feb 25, 2023 · 4 comments
Closed

min/max for complex inputs #67

ev-br opened this issue Feb 25, 2023 · 4 comments

Comments

@ev-br
Copy link
Collaborator

ev-br commented Feb 25, 2023

Pytorch throws RuntimeError: "min_values_cpu" not implemented for 'ComplexDouble'. Numpy does something: looks like it compares the real part and breaks ties with the imaginary part.

There are some tests in numpy_tests/core/test_multiarray.py::TestArgmax::test_combinations and ...::TestArgmin::...

@ev-br
Copy link
Collaborator Author

ev-br commented Feb 28, 2023

A similar issue exists for sorting and searching: argmin, argmax and searchsorted.

#65 (review) and #65 (comment) suggest to just disallow it:

What does it even mean to sort a complex anything?

I think numpy does essentially a lexicographic ordering: compare real parts and break ties with the imaginary part. Not sure though, and would rather agree that an arbitrary decision on how to impose order in the complex plane best needs a motivating use case.

@rgommers
Copy link
Member

+1 to disallow

@ev-br
Copy link
Collaborator Author

ev-br commented Apr 16, 2023

added to the list of current limitations in gh-73

@ev-br
Copy link
Collaborator Author

ev-br commented Apr 27, 2023

This is tracked / mentioned on gh-73, so let's close this.

@ev-br ev-br closed this as completed Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants