Skip to content

Minimize unnecessary array copying for ufuncs

  • All of our ufunc loops require that the input arrays are aligned, but Numpy's ufunc API takes care of that for us. Update comments about alignment warnings accordingly. See https://numpy.org/doc/stable/user/basics.ufuncs.html#use-of-internal-buffers.
  • Some of our ufunc loops require contiguous arrays. These need the require_contiguous_aligned wrapper, but the others do not. Remove the wrapper from ufuncs that do not need it, and add assertions to check the strides in the ufuncs that do need it.

Merge request reports

Loading