Hey Julianners,
I found a really strange behavior! But shit is pretty serious thing all in all.
using InteractiveUtils
struct me{I,O}
a::Vector{Array{Float32,I}}
b::Vector{Array{Float32,O}}
end
double(x::Vector{Array{Float32, 3}}) = 2 .* x
function foo(n)
double(n.a)
end
function bar()
m=me{3,2}([randn(Float32,2,3,4)],[randn(Float32,2,4)])
foo(m)
end
@code_warntype bar()
So bar is an uninterferable thing… which is strange… But ok.
Then running this code snippet:
@time bar();
@code_warntype bar()
double(x::Vector{Array{Float32, 3}}) = 2 .* x
@code_warntype bar()
After redefining double(…), bar() becomes an interferable class!!
What is going on here?
11 posts - 5 participants