Is this a bug?
julia> import JuMP
julia> model = JuMP.Model();
julia> x = map(_ -> JuMP.@variable(model), 1) # returns a SCALAR
_[1]
julia> ndims(x), ndims(1)
(0, 0)
julia> map(_ -> JuMP.@variable(model), x) # returns a Vector???
1-element Vector{JuMP.VariableRef}:
_[2]
I think the last return should be _[2]
solely, not wrapped in a Vector.
Yes, surely I think _[2]
should be the expected return, otherwise duplicating the following:
julia> model = JuMP.Model();
julia> x = map(_ -> JuMP.@variable(model), 1)
_[1]
julia> map(_ -> JuMP.@variable(model), [x])
1-element Vector{JuMP.VariableRef}:
_[2]
The julia’s behavior is sane:
julia> map(_ -> 1, 2)
1
julia> map(_ -> 1, [2])
1-element Vector{Int64}:
1