Re: [Cython] memoryview slice transpose

2014-04-07 Thread Syam Gadde
My patch actually addressed two slightly different issues, both of which have to do with refcounts of transposed slices. I'll address the first one below since that's the one that's not so obvious. Here's the code that causes an "Acquisition count is 0" error: import numpy cimport numpy def t

Re: [Cython] memoryview slice transpose

2014-04-06 Thread Stefan Behnel
Syam Gadde, 27.03.2014 21:29: > I wanted to re-offer for discussion a fix for a bug I reported a while > back. The code that breaks is this: > > import numpy > cimport numpy > > def testfunc(): > a = numpy.arange(12).reshape([3,4]) > cdef numpy.int_t[:,:] a_view = a > cdef numpy.int

[Cython] memoryview slice transpose

2014-03-27 Thread Syam Gadde
I wanted to re-offer for discussion a fix for a bug I reported a while back. The code that breaks is this: import numpy cimport numpy def testfunc(): a = numpy.arange(12).reshape([3,4]) cdef numpy.int_t[:,:] a_view = a cdef numpy.int_t[:,:] b = a_view[:,:].T One problem is that whe