-
Notifications
You must be signed in to change notification settings - Fork 9
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
Error when broadcasting across singleton dimension #75
Comments
This is a LoopVectorization broadcasting issue. That is, when an axis that would normally be contiguous in memory is of size A PR to LV to fix this would be welcome. You could look to the source of FastBroadcast.jl for ideas. |
I've run into this as well. How do I need to restrict the versions of Loopvectorisation and Stridearrays to avoid this? Or at least I think my problem is the same?? using StrideArrays, LinearAlgebra
_A = zeros(10,10)
A = PtrArray(_A)
A[:, :] .= randn(10,10)
b = randn(10)
d = sum( b[j] * A[1,j] for j = 1:10 )
@show dot(A[1, :], b) ≈ d # false
@show dot((@view A[1,:]), b) ≈ d # false
@show sum(A[1,:] .* b ) ≈ d # false
a1 = collect(@view A[1,:])
@show sum(a1 .* b ) ≈ d # true |
No, actually. |
fantastic, thank you! |
Using the latest version, I get garbage when broadcasting across a singleton dimension:
Note the numerical garbage in the trailing rows, which seems to come from uninitialized memory.
This also occurs when broadcasting in-place; the destination will end up with stuff from uninitialized memory.
I think I have enabled boundschecking, via
The text was updated successfully, but these errors were encountered: