aicenter / ConditionalDists.jl

Conditional probability distributions powered by DistributionsAD.jl
MIT License
21 stars 4 forks source link

GPU conversion #11

Closed vitskvara closed 4 years ago

vitskvara commented 4 years ago

See https://github.com/aicenter/GenerativeModels.jl/issues/72

I think the issue is in the functor definition. Now we have CMeanGaussian{V,S,M}, where M is the type of mapping. But consider this:

julia> m = Dense(3,2)
Dense(3, 2)

julia> typeof(m)
Dense{typeof(identity),Array{Float32,2},Array{Float32,1}}

julia> m = m |> gpu
Dense(3, 2)

julia> typeof(m)
Dense{typeof(identity),CuArray{Float32,2,Nothing},CuArray{Float32,1,Nothing}}

Clearly, the type changes when moving to the gpu. However, in the functor redefinition, the type M is static.

nmheim commented 4 years ago

closed with #12