Why is it a requirement for `X` to C-contiguous and `float64`? I think your implementation should work no matter the type of the array, since everything is done in Python (i.e., no Cython code and no type restriction).