-
Notifications
You must be signed in to change notification settings - Fork 2.2k
vectorize dispatch std::complex issue #631
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
Comments
Similarly, adding an overload for 'float':
I see x.dtype is
which tells me that an array(float) was converted to array(double) |
Pybind's default overload dispatch tries in FIFO order, and stops when one works. That means the |
I followed this example: to do my own dispatch:
I believe it is working |
I think it's unfortunate that function overloads of
I think it would be better if f(py::array) would allow conversion, while f(py::array_t) would not, although I don't know how that could be implemented. |
It seems to be, but it reveals a small bug in printing |
I believe the signature there is intentionally a generic |
Sorry, that message wasn't rendered correctly, what I meant to say was
The issue is that messages 1 and 2 both say 'float', while the actual c++ types are 'double' and 'float', and similarly for messages 3 and 4. |
Ah, sorry, I thought it was about the return type. The arguments types are indeed confusing. I guess the best thing would be to have it say |
produces:
This leads me to believe that the wrong ufunc was dispatched, when given complex data type, the scalar overload was erroneously chosen.
This is confirmed by commenting out the scalar overload, in which case there is no message and a correct result is returned.
The text was updated successfully, but these errors were encountered: