Skip to content

Commit

Permalink
Bugfix in model evaluation not using SMC samplers (#2057)
Browse files Browse the repository at this point in the history
* Update AdvancedSMC.jl

* Update Project.toml
  • Loading branch information
yebai authored Jul 31, 2023
1 parent c2c2a70 commit 9f3ab01
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "Turing"
uuid = "fce5fe82-541a-59a6-adf8-730c64b5f9a0"
version = "0.28"
version = "0.28.1"


[deps]
Expand Down
7 changes: 4 additions & 3 deletions src/inference/AdvancedSMC.jl
Original file line number Diff line number Diff line change
Expand Up @@ -331,15 +331,16 @@ function DynamicPPL.assume(
vn::VarName,
__vi__::AbstractVarInfo
)
local vi
trace = AdvancedPS.current_trace()
trng = trace.rng
local vi, trng
try
trace = AdvancedPS.current_trace()
trng = trace.rng
vi = trace.model.f.varinfo
catch e
# NOTE: this heuristic allows Libtask evaluating a model outside a `Trace`.
if e == KeyError(:__trace) || current_task().storage isa Nothing
vi = __vi__
trng = rng
else
rethrow(e)
end
Expand Down

2 comments on commit 9f3ab01

@yebai
Copy link
Member Author

@yebai yebai commented on 9f3ab01 Jul 31, 2023

Choose a reason for hiding this comment

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

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/88733

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.28.1 -m "<description of version>" 9f3ab016baf30207b91e7fdc5fa0a9a1d468cf39
git push origin v0.28.1

Please sign in to comment.