-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stride
/strides
signature too broad?
#17812
Comments
The |
I'm working on resolving this issue (in conjunction with #25247) but there seems to be confusion on what I take it this comment https://github.com/JuliaLang/julia/blob/master/base/subarray.jl#L254 is wrong? And the code below involving |
Yes, the two notions (is it memory layout or is it essentially In this case, though, I think the comment is referring to the fact that in
As you suggest, perhaps the best rewrite would be in terms of calling |
OK, I've done that in https://github.com/dlfivefifty/julia/tree/dl/stridedarrayinterface and just need to fix some lingering abuses in sparsevector.jl. |
The docstring for
stride
:specifies "in memory", but the signature for
stride
isstride(a::AbstractArray, i::Integer)
, and someAbstractArray
s do not even store their values in memory:Should we change it to
StridedArray
? The biggest problem with this is thatStridedArray
was the motivating poster child for the desirability of traits, becauseStridedArray
cannot be extended to user types.We could introduce an
IsStrided
trait,and dispatch on it for
strides
andstride
. But then that implicitly places some expectation that the linear algebra code might switch to the trait rather than dispatching onStridedArray
, and that's a lot of code to modify. So I didn't want to do this lightly.The text was updated successfully, but these errors were encountered: