-
Notifications
You must be signed in to change notification settings - Fork 232
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
Missing dispatch for indexing of reshaped arrays #556
Comments
What do you expect here exactly? |
It's contiguous: julia> x = reshape(1:100,10,10)
10×10 reshape(::UnitRange{Int64}, 10, 10) with eltype Int64:
1 11 21 31 41 51 61 71 81 91
2 12 22 32 42 52 62 72 82 92
3 13 23 33 43 53 63 73 83 93
4 14 24 34 44 54 64 74 84 94
⋮ ⋮
7 17 27 37 47 57 67 77 87 97
8 18 28 38 48 58 68 78 88 98
9 19 29 39 49 59 69 79 89 99
10 20 30 40 50 60 70 80 90 100
julia> @view x[reshape(1:4,2,2)]
2×2 view(::UnitRange{Int64}, [1 3; 2 4]) with eltype Int64:
1 3
2 4 |
It may be in practice, but
vs
|
I think I can work around it: SciML/DiffEqFlux.jl#451 |
Note that on CPUs, that other form is treated as a contiguous array by BLAS via JuliaLang/julia#34729 |
That's a good reference, thanks. I'm wary to copy it here though, because these unions have a tendency of wrecking package import latency... |
The original MWE here seems to work now. |
This is because
W
is a SubArray`. However, the other method works:This is different from Array semantics:
where the latter is more optimized with BLAS due to some of @mbauman 's fanciness.
The text was updated successfully, but these errors were encountered: