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
Currently reshape accepts a combination of Base.OneTo and Ints to specify the new shape, with the possibility of specifying one dimension implicitly through a Colon. However it is not possible to couple a Colon with a Base.OneTo.
julia> r =ones(2)
2-element Vector{Float64}:1.01.0
julia>reshape(r, Base.OneTo(2), 1) # works2×1 Matrix{Float64}:1.01.0
julia>reshape(r, 2, :) # works2×1 Matrix{Float64}:1.01.0
julia>reshape(r, Base.OneTo(2), :) # doesn't work
ERROR: MethodError: no method matching reshape(::Vector{Float64}, ::Base.OneTo{Int64}, ::Colon)
Closest candidates are:reshape(::AbstractArray, ::Union{Int64, AbstractUnitRange}...) at reshapedarray.jl:110reshape(::AbstractArray, ::Union{Colon, Int64}...) at reshapedarray.jl:117reshape(::Array{T, M}, ::Tuple{Vararg{Int64, N}}) where {T, N, M} at reshapedarray.jl:40...
Stacktrace:
[1] top-level scope
@ REPL[8]:1
The text was updated successfully, but these errors were encountered:
Currently
reshape
accepts a combination ofBase.OneTo
andInt
s to specify the new shape, with the possibility of specifying one dimension implicitly through aColon
. However it is not possible to couple aColon
with aBase.OneTo
.The text was updated successfully, but these errors were encountered: