6

I am manually modifying the shape and strides of NumPy arrays which may (or may not) invalidate the contiguity flags.

  1. Do I have to then manually check whether the strides match the values you would expect from the shape and NPY_C_CONTIGUOUS (or NPY_F_CONTIGUOUS)?
  2. Is there an API function which will do this for me and automatically clear or enable flags as is appropriate?
embert
  • 7,336
  • 10
  • 49
  • 78
Alex Rubinsteyn
  • 420
  • 4
  • 8

1 Answers1

1

I haven't tried these myself so I am not entirely clear on their use but you may try to employ:

  1. PyArray_CLEARFLAGS
  2. PyArray_ENABLEFLAGS

Found in the Numpy v1.7 Array API

Joel Vroom
  • 1,611
  • 1
  • 16
  • 30