File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -438,24 +438,26 @@ function check_model_and_trace(
438
438
rng:: Random.AbstractRNG ,
439
439
model:: Model ;
440
440
varinfo= VarInfo (),
441
- context= SamplingContext (rng),
442
441
error_on_failure= false ,
443
442
kwargs... ,
444
443
)
445
444
# Execute the model with the debug context.
446
445
debug_context = DebugContext (
447
- model, context; error_on_failure= error_on_failure, kwargs...
446
+ model,
447
+ SamplingContext (rng, model. context);
448
+ error_on_failure= error_on_failure,
449
+ kwargs... ,
448
450
)
451
+ debug_model = DynamicPPL. contextualize (model, debug_context)
449
452
450
453
# Perform checks before evaluating the model.
451
- issuccess = check_model_pre_evaluation (debug_context, model )
454
+ issuccess = check_model_pre_evaluation (debug_context, debug_model )
452
455
453
456
# Force single-threaded execution.
454
- debug_model = DynamicPPL. contextualize (model, debug_context)
455
457
DynamicPPL. evaluate_threadunsafe!! (debug_model, varinfo)
456
458
457
459
# Perform checks after evaluating the model.
458
- issuccess &= check_model_post_evaluation (debug_context, model )
460
+ issuccess &= check_model_post_evaluation (debug_context, debug_model )
459
461
460
462
if ! issuccess && error_on_failure
461
463
error (" model check failed" )
You can’t perform that action at this time.
0 commit comments