Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/sampler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ function set_values!!(
flattened_param_vals = varinfo[spl]
length(flattened_param_vals) == length(initial_params) || throw(
DimensionMismatch(
"Provided initial value size ($(length(initial_params))) doesn't match the model size ($(length(theta)))",
"Provided initial value size ($(length(initial_params))) doesn't match the model size ($(length(flattened_param_vals)))",
),
)

Expand Down
1 change: 1 addition & 0 deletions test/sampler.jl
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@
chain1 = sample(model, sampler, 1; progress=false)
Random.seed!(1234)
chain2 = sample(model, sampler, 1; initial_params=nothing, progress=false)
@test_throws DimensionMismatch sample(model, sampler, 1; progress=false, initial_params=zeros(10))
@test chain1[1].metadata.m.vals == chain2[1].metadata.m.vals
@test chain1[1].metadata.s.vals == chain2[1].metadata.s.vals

Expand Down
Loading