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

.~ is broken for MvNormal #27

Closed
xukai92 opened this issue Jan 9, 2020 · 1 comment · Fixed by TuringLang/Turing.jl#1076
Closed

.~ is broken for MvNormal #27

xukai92 opened this issue Jan 9, 2020 · 1 comment · Fixed by TuringLang/Turing.jl#1076

Comments

@xukai92
Copy link
Member

xukai92 commented Jan 9, 2020

using Turing

@model mwe(::Type{T}=Float64) where {T<:Real} = begin
    m = Matrix{T}(undef, 2, 3)
    m .~ MvNormal(zeros(2), 1)
end

sample(mwe(), HMC(0.2, 4), 1_000)

gives

MethodError: no method matching dim(::MvNormal{Float64,PDMats.ScalMat{Float64},Array{Float64,1}})
Closest candidates are:
  dim(!Matched::PDMats.PDMat) at /afs/inf.ed.ac.uk/user/s16/s1672897/.julia/packages/PDMats/nKT0N/src/pdmat.jl:30
  dim(!Matched::PDMats.PDSparseMat) at /afs/inf.ed.ac.uk/user/s16/s1672897/.julia/packages/PDMats/nKT0N/src/pdsparsemat.jl:30
  dim(!Matched::PDMats.PDiagMat) at /afs/inf.ed.ac.uk/user/s16/s1672897/.julia/packages/PDMats/nKT0N/src/pdiagmat.jl:26
  ...
@mohamed82008
Copy link
Member

Should be fixed in TuringLang/DistributionsAD.jl#19.

devmotion added a commit to devmotion/Turing.jl that referenced this issue Jan 16, 2020
yebai pushed a commit to TuringLang/Turing.jl that referenced this issue Jan 16, 2020
* Fix TuringLang/DynamicPPL.jl#27

* Add regression test

* Fix test error on Julia 1.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants