-
-
Notifications
You must be signed in to change notification settings - Fork 12.1k
Closed
Description
The clipping code contains lines like:
npy_intp is1 = steps[0] / sizeof(T), os1 = steps[3] / sizeof(T);
NumPy guarantees that ufunc data is aligned, but NumPy does not guarantee that alignment is equal to the itemsize. (in particularly, that is clearly not true for complex numbers)
As the quick fix: The code shouldn't use this pattern at all, I think.
But even if we ignore complex (because clipping and complex are weird), do platforms even guarantee that for the basic numerical types? Should code at least have a static_assert() or so if using such a pattern?
(xref gh-26280 because that is why I noticed)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels