Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gpu fix #12

Merged
merged 5 commits into from
Jan 5, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/cmean_gaussian.jl
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ mean_var(p::CMeanGaussian, z::AbstractArray) = (mean(p, z), variance(p, z))
function Flux.functor(p::CMeanGaussian{V,S,M}) where {V,S,M}
fs = fieldnames(typeof(p))
nt = (; (name=>getfield(p, name) for name in fs)...)
nt, y -> CMeanGaussian{V,S,M}(y...)
nt, y -> CMeanGaussian{V,S,typeof(gpu(p.mapping))}(y...)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This only fixes the mapping conversion, however the σ field is still not converted.

Copy link
Collaborator Author

@vitskvara vitskvara Dec 18, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, this is probably going to break if one has CuArrays loaded, the model is on cpu and functor is not called in the gpu conversion process - what are the places where functor is called?

end

function Flux.trainable(p::CMeanGaussian)
Expand Down