-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
np.empty support list type in argument #3143
Comments
Thanks for the report. I think the problem here is that |
shape
parameter in list not supported
note: Edited title to reflect problem. |
I'm running into this problem because For example, @njit
def zeros(d):
return np.zeros(np.full(d, 2)) raises a TypingError |
@umangv thanks for the report. As noted above, lists are not supported for anything that needs |
Interesting, so you need to know the dimension of the desired array at compile time but not necessarily the shape/size. That was the distinction that I was missing. |
Was about to open a bug report (instead of a feature request) about this: numpy does support it and this says that Anyway, it is possible to work around the problem in some (very) specific cases since #2691 without too much trickery or having to get back to the interpreter:
It's not really solving the problem but in specific cases where the number of dimensions is known from the start, everything can be JITed like that without exiting Numba. |
I know it should be a small issue, anyone comes across it can resolve by simply altering his code a little bit. But for those used to MATLAB, the small issue is just annoying.
The text was updated successfully, but these errors were encountered: