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
"resize" attribute of numpy array #8015
Comments
Maybe I can try working on this? @guilhermeleobas @stuartarchibald |
I think both |
np.resize seems a pure python function. ndarray.resize is different. |
Okay. I will prioritise |
@czgdp1807 I don't recall there being/can't find any open PR doing the same, so if it's something you'd like to work on, then patches are welcomed, thanks! Also, as noted, |
Great. I am working on it. Will open a PR soon (a couple of days may be). |
@Rinoahu N.B. - #8020 (comment) |
This patch: * Updates nrt.c to ensure that allocation routines return NULL if the allocation fails. cf. malloc. * Updates the nrt.context to add a check that wraps any allocation routine to check if the allocation failed and if so raises a MemoryError. * Fixes the runtime system allocators to catch invalid allocation requests and handle failed allocation requests. * Adds tests for the above. * Fixes a storage classifier issue in the C code in the nrt tests. * Adds the option `--debuginfo` to the `build_ext` command in setup.py, on unix systems this will ensure the DSOs Numba produces are built with debug symbols. Fixes numba#8015 (the segfault part).
This patch: * Updates nrt.c to ensure that allocation routines return NULL if the allocation fails. cf. malloc. * Updates the nrt.context to add a check that wraps any allocation routine to check if the allocation failed and if so raises a MemoryError. * Fixes the runtime system allocators to catch invalid allocation requests and handle failed allocation requests. * Adds tests for the above. * Fixes a storage classifier issue in the C code in the nrt tests. * Adds the option `--debuginfo` to the `build_ext` command in setup.py, on unix systems this will ensure the DSOs Numba produces are built with debug symbols. * Adds an update to the notes in nrt_external.h about the expected behaviour of an externally supplied allocation routine. Fixes numba#8015 (the segfault part).
Am going to close this as it was established in #8020 that Numba cannot support |
Feature request
Dear Developer Team,
Could you please add the "resize" attribute to numpy arrays? When increasing the size of a numpy array, "resize" seems to be more memory-efficient than creating a new numpy array and deleting the old one.
Best,
R.H.
The text was updated successfully, but these errors were encountered: