mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-22 21:25:13 +00:00
ae5a8f7eb3
The only part of the vectorize code that actually needs c-contiguous is the "trivial" broadcast; for non-trivial arguments, the code already uses strides properly (and so handles C-style, F-style, neither, slices, etc.) This commit rewrites `broadcast` to additionally check for C-contiguous storage, then takes off the `c_style` flag for the arguments, which will keep the functionality more or less the same, except for no longer requiring an array copy for non-c-contiguous input arrays. Additionally, if we're given a singleton slice (e.g. a[0::4, 0::4] for a 4x4 or smaller array), we no longer fail triviality because the trivial code path never actually uses the strides on a singleton. |
||
---|---|---|
.. | ||
pybind11 |