Skip to content

Commit

Permalink
Merge 1d9fa5e into 955a562
Browse files Browse the repository at this point in the history
  • Loading branch information
FredericWantiez committed Nov 8, 2023
2 parents 955a562 + 1d9fa5e commit 439d3f9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
name = "AdvancedPS"
uuid = "576499cb-2369-40b2-a588-c64705576edc"
authors = ["TuringLang"]
version = "0.5.3"
version = "0.5.4"

[deps]
AbstractMCMC = "80f14c24-f653-4e6a-9b94-39d6b0f70001"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
Libtask = "6f1fad26-d15e-5dc8-ae53-837a1d7b8c9f"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Random123 = "74087812-796a-5b5d-8853-05524746bad3"
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
Expand Down
7 changes: 6 additions & 1 deletion ext/AdvancedPSLibtaskExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,13 @@ function AdvancedPS.LibtaskModel(
)
end

"""
copy(model::AdvancedPS.LibtaskModel)
The task is copied (forked) and the inner model is deepcopied.
"""
function Base.copy(model::AdvancedPS.LibtaskModel)
return AdvancedPS.LibtaskModel(model.f, copy(model.ctask))
return AdvancedPS.LibtaskModel(deepcopy(model.f), copy(model.ctask))
end

const LibtaskTrace{R} = AdvancedPS.Trace{<:AdvancedPS.LibtaskModel,R}
Expand Down

0 comments on commit 439d3f9

Please sign in to comment.