You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The fix is to add empty function in lpython_intrinsic_numpy.py but that gets tricker when we need robust generics(I didn't try that much with the current structure that we have) since empty takes different argument types like empty(2), empty((2, 3)), empty([2, 3]), etc. and also returns difference types.
Activity
Thirumalai-Shaktivel commentedon May 15, 2023
Can you please share a minimal example?
This seems to work:
a.py
Smit-create commentedon May 15, 2023
Maybe this is something that's fixed by: #1795?
Thirumalai-Shaktivel commentedon May 15, 2023
Yup, might be!
certik commentedon May 15, 2023
Excellent, indeed it works for user code now, I verified it. However, it doesn't work for numpy:
gives:
Smit-create commentedon May 15, 2023
I think, its because we have a hard-coded
emptyinCall.lpython/src/lpython/semantics/python_ast_to_asr.cpp
Lines 6808 to 6812 in 9941f2c
certik commentedon May 15, 2023
Yes, it's probably time to fix this.
Smit-create commentedon May 16, 2023
The fix is to add
emptyfunction inlpython_intrinsic_numpy.pybut that gets tricker when we need robust generics(I didn't try that much with the current structure that we have) sinceemptytakes different argument types likeempty(2),empty((2, 3)),empty([2, 3]), etc. and also returns difference types.certik commentedon Jun 6, 2023
I would support:
and fail on:
And succeed on: