Skip to content

Commit 7deaaab

Browse files
committed
Enable InitFromPrior and InitFromUniform too
1 parent f330d59 commit 7deaaab

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/fasteval.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ using DynamicPPL:
6060
AbstractContext,
6161
AbstractVarInfo,
6262
AccumulatorTuple,
63+
InitContext,
64+
InitFromParams,
65+
InitFromPrior,
66+
InitFromUniform,
6367
LogJacobianAccumulator,
6468
LogLikelihoodAccumulator,
6569
LogPriorAccumulator,
@@ -123,6 +127,9 @@ function DynamicPPL.get_param_eltype(
123127
return eltype(leaf_ctx.params)
124128
elseif leaf_ctx isa InitContext{<:Any,<:InitFromParams}
125129
return DynamicPPL.infer_nested_eltype(leaf_ctx.strategy.params)
130+
elseif leaf_ctx isa InitContext{<:Any,<:Union{InitFromPrior,InitFromUniform}}
131+
# No need to enforce any particular eltype here, since new parameters are sampled
132+
return Any
126133
else
127134
error(
128135
"OnlyAccsVarInfo can only be used with FastEval contexts, found $(typeof(leaf_ctx))",

0 commit comments

Comments
 (0)