You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
julia> a =ones(2)
2-element Array{Float64,1}:
julia>repeat(a,1,2,3)
2×2×3 Array{Float64,3}:
For Array more than 1-d, this doesn't
julia> a =ones(2,2)
2×2 Array{Float64,2}:
julia>repeat(a,1,2,3) # I think this should work
ERROR: BoundsError: attempt to access 2×4×3 Array{Float64,3} at index [Base.OneTo(2), Base.OneTo(2)]
But this does,
julia> a =ones(2,2)
2×2 Array{Float64,2}:
julia>repeat(a,1,1,1)
2×2×1 Array{Float64,3}:
A temporary solution to repeat in higher dimension is to reshape first
julia> a =ones(2,2)
2×2 Array{Float64,2}:
julia>repeat(repeat(a,1,1,1),1,2,3)
2×4×3 Array{Float64,3}:
Platform Info:
OS: Linux (x86_64-redhat-linux)
CPU: Intel(R) Core(TM) i7-6800K CPU @ 3.40GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-6.0.0 (ORCJIT, broadwell)
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
For simplicity, I remove part of results
For 1-d
Vector
, this worksFor
Array
more than 1-d, this doesn'tBut this does,
A temporary solution to repeat in higher dimension is to reshape first
Platform Info:
OS: Linux (x86_64-redhat-linux)
CPU: Intel(R) Core(TM) i7-6800K CPU @ 3.40GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-6.0.0 (ORCJIT, broadwell)
The text was updated successfully, but these errors were encountered: