File tree 1 file changed +6
-6
lines changed
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change 51
51
function DynamicPPL. _determine_varinfo_jet (
52
52
model:: DynamicPPL.Model , context:: DynamicPPL.AbstractContext ; only_tilde:: Bool = true
53
53
)
54
- # First we try with the typed varinfo.
55
- varinfo = if DynamicPPL. hassampler (context)
56
- # Don't need to add sampling context for this to work.
57
- DynamicPPL. typed_varinfo (model, context)
54
+ # We need a sampling context in the stack to initialize the varinfo.
55
+ sampling_context = if DynamicPPL. hassampler (context)
56
+ context
58
57
else
59
- # Need a sampling context to initialize the varinfo.
60
58
DynamicPPL. typed_varinfo (model, DynamicPPL. SamplingContext (context))
61
59
end
60
+ # First we try with the typed varinfo.
61
+ varinfo = DynamicPPL. typed_varinfo (model, sampling_context)
62
62
issuccess = true
63
63
64
64
# Let's make sure that both evaluation and sampling doesn't result in type errors.
@@ -78,7 +78,7 @@ function DynamicPPL._determine_varinfo_jet(
78
78
else
79
79
# Warn the user that we can't use the type stable one.
80
80
@warn " Model seems incompatible with typed varinfo. Falling back to untyped varinfo."
81
- DynamicPPL. untyped_varinfo (model)
81
+ DynamicPPL. untyped_varinfo (model, sampling_context )
82
82
end
83
83
end
84
84
You can’t perform that action at this time.
0 commit comments