-
Notifications
You must be signed in to change notification settings - Fork 16
Add vectorized searchsorted #531
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
base: main
Are you sure you want to change the base?
Conversation
tests/test_funcs.py
Outdated
| x[mask] = -np.inf | ||
| mask = rng.random(shape) > 0.9 | ||
| x[mask] = np.inf | ||
| x = np.sort(x, stable=True, axis=-1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is unnecessary and causing CI failures.
| x = np.sort(x, stable=True, axis=-1) | |
| x = np.sort(x, axis=-1) |
|
Re: I don't really want to deal with typing or GHA lint complaints in I don't know what to do about GHA's lint complaints in |
How are you seeing these failures? Via |
|
Yup |
|
bizarre! |
|
maybe it's all because |
|
seems to be the problem yes, I fear it might be something windows-specific. |
|
K, well I got on my mac, fixed most of the complaints, and silenced the rest. |
Addresses scipy/scipy#23930 (comment)
Thoughts:
searchsortedfor all 1D tests. It would be good to have some way of running the 1D test cases with the genericsearchsortedcode, though. The important part is the length of the arrays along the last axis, so the simplest way would be to just define 2D cases with the same lengths along the second axis.torchdelegates multidimensional cases totorch.searchsorted, too, but it behaves differently than other backends in some cases involving NaNs. It doesn't surprise me because the standard doesn't define sorting w/ NaNs and torch doesn't always do the typical thing. Not sure how deeply we want to go into that.broadcast_shapesto help with that, but I would prefer not to work on that. I could add a check for this condition and raise a consistent error, if that would be sufficient.sideis one of the allowed values?