File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change 1
1
name = " AdvancedPS"
2
2
uuid = " 576499cb-2369-40b2-a588-c64705576edc"
3
3
authors = [" TuringLang" ]
4
- version = " 0.3"
4
+ version = " 0.3.1 "
5
5
6
6
[deps ]
7
7
AbstractMCMC = " 80f14c24-f653-4e6a-9b94-39d6b0f70001"
@@ -13,6 +13,6 @@ StatsFuns = "4c63d2b9-4356-54db-8cca-17b64c39e42c"
13
13
[compat ]
14
14
AbstractMCMC = " 2, 3"
15
15
Distributions = " 0.23, 0.24, 0.25"
16
- Libtask = " 0.6"
16
+ Libtask = " 0.6.2 "
17
17
StatsFuns = " 0.9"
18
18
julia = " 1.3"
Original file line number Diff line number Diff line change 6
6
const Particle = Trace
7
7
8
8
function Trace (f)
9
- ctask = Libtask. CTask (f)
9
+ if hasfield (typeof (f), :evaluator ) # Test whether f is a Turing.TracedModel
10
+ # println(f.evaluator)
11
+ ctask = Libtask. CTask (f. evaluator[1 ], f. evaluator[2 : end ]. .. )
12
+ else # f is a Function, or AdavncedPS.Model
13
+ ctask = Libtask. CTask (f)
14
+ end
10
15
11
16
# add backward reference
12
17
newtrace = Trace (f, ctask)
42
47
# Create new task and copy randomness
43
48
function forkr (trace:: Trace )
44
49
newf = reset_model (trace. f)
45
- ctask = Libtask. CTask (trace. ctask)
50
+ # ctask = Libtask.CTask(trace.ctask)
51
+ if hasfield (typeof (newf), :evaluator ) # Test whether f is a Turing.TracedModel
52
+ ctask = Libtask. CTask (newf. evaluator[1 ], newf. evaluator[2 : end ]. .. )
53
+ else # f is a Function, or AdavncedPS.Model
54
+ ctask = Libtask. CTask (newf)
55
+ end
46
56
47
57
# add backward reference
48
58
newtrace = Trace (newf, ctask)
You can’t perform that action at this time.
0 commit comments