Is there a NumPy C API function that will reset the layout flags?

I manually change the shape and steps of the NumPy arrays, which may (or may not) invalidate adjacency flags.

  • Do I have to manually check if the steps match the values ​​you expect from the form and NPY_C_CONTIGUOUS (or NPY_F_CONTIGUOUS )?
  • Is there an API function that will do this for me and automatically clear or enable flags, as appropriate?
+6
source share
1 answer

I have not tried them myself, so I do not quite understand their use, but you can try to use:

  • PyArray_CLEARFLAGS
  • PyArray_ENABLEFLAGS

Found in the Numpy v1.7 API

+1
source

Source: https://habr.com/ru/post/954300/


All Articles