JuliaLabs / Cassette.jl

Overdub Your Julia Code
Other
371 stars 35 forks source link

Possible bug #127

Closed shashikdm closed 5 years ago

shashikdm commented 5 years ago
using Cassette
using Flux

d = Dense(3,3)
data = rand(3)

Cassette.@context Ctx;

Cassette.overdub(Ctx(), d, data)

I get the following error:

ERROR: LoadError: type DataType has no field W

is this is a bug in Cassette or I'm doing something wrong?

vchuravy commented 5 years ago

Can you post a full error log?

shashikdm commented 5 years ago
julia> Cassette.overdub(Ctx(), d, data)
ERROR: type DataType has no field W
Stacktrace:
 [1] getproperty at ./sysimg.jl:15 [inlined]
 [2] call at /home/shashi/.julia/packages/Cassette/xggAf/src/context.jl:447 [inlined]
 [3] fallback at /home/shashi/.julia/packages/Cassette/xggAf/src/context.jl:445 [inlined]
 [4] overdub at /home/shashi/.julia/packages/Cassette/xggAf/src/context.jl:271 [inlined]
 [5] Dense at /home/shashi/.julia/packages/Flux/qXNjB/src/layers/basic.jl:98 [inlined]
 [6] overdub(::Cassette.Context{nametype(Ctx),Nothing,Nothing,getfield(Cassette, Symbol("##PassType#363")),Nothing,Nothing}, ::typeof(invoke), ::Dense{typeof(identity),TrackedArray{…,Array{Float32,2}},TrackedArray{…,Array{Float32,1}}}, ::Type{Tuple{AbstractArray}}, ::Array{Float32,1}) at /home/shashi/.julia/packages/Cassette/xggAf/src/overdub.jl:0
 [7] Dense at /home/shashi/.julia/packages/Flux/qXNjB/src/layers/basic.jl:110 [inlined]
 [8] overdub(::Cassette.Context{nametype(Ctx),Nothing,Nothing,getfield(Cassette, Symbol("##PassType#363")),Nothing,Nothing}, ::Dense{typeof(identity),TrackedArray{…,Array{Float32,2}},TrackedArray{…,Array{Float32,1}}}, ::Array{Float32,1}) at /home/shashi/.julia/packages/Cassette/xggAf/src/overdub.jl:0
 [9] overdub(::Cassette.Context{nametype(Ctx),Nothing,Nothing,getfield(Cassette, Symbol("##PassType#363")),Nothing,Nothing}, ::Dense{typeof(identity),TrackedArray{…,Array{Float32,2}},TrackedArray{…,Array{Float32,1}}}, ::Array{Float64,1}) at /home/shashi/.julia/packages/Flux/qXNjB/src/layers/basic.jl:113
 [10] top-level scope at none:0
vchuravy commented 5 years ago

Okay, having looked into this a bit this seems to be a Cassette bug at the intersection of invoke, and types that do call-overloading. The arguments are a bit in the wrong order.