Here is an example.
function test_func()
array1 = rand(Float64,10,10)
array2 = rand(Float64,10,10)
out = cat(array1,array2,dims=1)
return out
end
@code_warntype test_func()
Variables
#self#::Core.Compiler.Const(test_func, false)
array1::Array{Float64,2}
array2::Array{Float64,2}
out::Any
Body::Any
1 ─ (array1 = Main.rand(Main.Float64, 10, 10))
│ (array2 = Main.rand(Main.Float64, 10, 10))
│ %3 = (:dims,)::Core.Compiler.Const((:dims,), false)
│ %4 = Core.apply_type(Core.NamedTuple, %3)::Core.Compiler.Const(NamedTuple{(:dims,),T} where T<:Tuple, false)
│ %5 = Core.tuple(1)::Core.Compiler.Const((1,), false)
│ %6 = (%4)(%5)::Core.Compiler.Const((dims = 1,), false)
│ %7 = Core.kwfunc(Main.cat)::Core.Compiler.Const(Base.var"#cat##kw"(), false)
│ %8 = array1::Array{Float64,2}
│ (out = (%7)(%6, Main.cat, %8, array2))
└── return out
Both vcat and hcat work just fine though.
function test_func()
array1 = rand(Float64,10,10)
array2 = rand(Float64,10,10)
out = vcat(array1,array2)
return out
end
@code_warntype test_func()
Variables
#self#::Core.Compiler.Const(test_func, false)
array1::Array{Float64,2}
array2::Array{Float64,2}
out::Array{Float64,2}
Body::Array{Float64,2}
1 ─ (array1 = Main.rand(Main.Float64, 10, 10))
│ (array2 = Main.rand(Main.Float64, 10, 10))
│ (out = Main.vcat(array1, array2))
└── return out
Am I doing something wrong or is it a bug?