Skip to content

Commit

Permalink
Simplify regenerate for distributions
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-lew committed Aug 20, 2022
1 parent a09d1cc commit af6fbfc
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/distribution.jl
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ end
(new_tr, weight, NoChange())
end
@inline function Gen.regenerate(tr::DistributionTrace, args::Tuple, argdiffs::Tuple, selection::AllSelection)
new_val = random(dist(tr), args...)
new_tr = DistributionTrace(new_val, args, dist(tr))
new_tr = simulate(dist(tr), args)
(new_tr, 0., UnknownChange())
end
@inline function Gen.propose(dist::Distribution, args::Tuple)
Expand Down

0 comments on commit af6fbfc

Please sign in to comment.