[Numpy-discussion] "expected a single-segment buffer object"
Thu Jul 10 10:33:58 CDT 2008
2008/7/9 Robert Kern <email@example.com>:
> Because that's just what a buffer= argument *is*. It is not a place
> for presenting the starting pointer to exotically-strided memory. Use
> __array_interface__s to describe the full range of representable
> memory. See below.
Aha! Is this stuff documented somewhere?
> I was about a week ahead of you. See numpy/lib/stride_tricks.py in the trunk.
Nice! Unfortunately it can't quite do what I want... for the linear
algebra I need something that can broadcast all but certain axes. For
example, take an array of matrices and an array of vectors. The
"array" axes need broadcasting, but you can't broadcast on all axes
without (incorrectly) turning the vector into a matrix. I've written a
(messy) implementation, but the corner cases are giving me headaches.
I'll let you know when I have something that works.
More information about the Numpy-discussion