@@ -12,21 +12,21 @@ function AbstractMCMC.bundle_samples(
12
12
kwargs...
13
13
)
14
14
# Turn all the transitions into a vector-of-vectors.
15
- vals = copy ( reduce (hcat, [vcat (t. params, t. lp) for t in ts]) ' )
15
+ vals = [vcat (t. params, t. lp) for t in ts]
16
16
17
17
# Check if we received any parameter names.
18
18
if ismissing (param_names)
19
- param_names = [" param_$i " for i in 1 : length (s. init_params)]
19
+ param_names = [Symbol ( : param_, i) for i in 1 : length (s. init_params)]
20
20
else
21
- # Deepcopy to be thread safe.
22
- param_names = deepcopy (param_names)
21
+ # Generate new array to be thread safe.
22
+ param_names = Symbol . (param_names)
23
23
end
24
24
25
25
# Add the log density field to the parameter names.
26
- push! (param_names, " lp " )
26
+ push! (param_names, :lp )
27
27
28
28
# Bundle everything up and return a Chains struct.
29
- return Chains (vals, param_names, (internals= [ " lp " ],))
29
+ return Chains (vals, param_names, (internals = [ :lp ],))
30
30
end
31
31
32
32
function AbstractMCMC. bundle_samples (
@@ -56,15 +56,15 @@ function AbstractMCMC.bundle_samples(
56
56
57
57
# Check if we received any parameter names.
58
58
if ismissing (param_names)
59
- param_names = [" param_$i " for i in 1 : length (ts[1 ][1 ]. params)]
59
+ param_names = [Symbol ( : param_, i) for i in 1 : length (ts[1 ][1 ]. params)]
60
60
else
61
- # Deepcopy to be thread safe.
62
- param_names = deepcopy (param_names)
61
+ # Generate new array to be thread safe.
62
+ param_names = Symbol . (param_names)
63
63
end
64
64
65
65
# Add the log density field to the parameter names.
66
- push! (param_names, " lp " )
66
+ push! (param_names, :lp )
67
67
68
68
# Bundle everything up and return a Chains struct.
69
- return Chains (vals, param_names, (internals= [" lp " ],))
70
- end
69
+ return Chains (vals, param_names, (internals= [:lp ],))
70
+ end
0 commit comments