Skip to content

Commit b60aaec

Browse files
committed
Merge remote-tracking branch 'origin/torfjelde/code-warntype' into torfjelde/code-warntype
2 parents 6a42613 + 68295e8 commit b60aaec

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/debug_utils.jl

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,12 @@ Check the type stability of the model's evaluator, warning about any potential i
686686
687687
This simply calls `@code_warntype` on the model's evaluator, filling in internal arguments where needed.
688688
"""
689-
function model_warntype(model::Model, varinfo::AbstractVarInfo=VarInfo(model), context::AbstractContext=DefaultContext(); optimize::Bool=true)
689+
function model_warntype(
690+
model::Model,
691+
varinfo::AbstractVarInfo=VarInfo(model),
692+
context::AbstractContext=DefaultContext();
693+
optimize::Bool=false
694+
)
690695
args, kwargs = DynamicPPL.make_evaluate_args_and_kwargs(model, varinfo, context)
691696
return if isempty(kwargs)
692697
InteractiveUtils.@code_warntype optimize=optimize model.f(args...)
@@ -702,7 +707,12 @@ Return the type inference for the model's evaluator.
702707
703708
This simply calls `@code_typed` on the model's evaluator, filling in internal arguments where needed.
704709
"""
705-
function model_typed(model::Model, varinfo::AbstractVarInfo=VarInfo(model), context::AbstractContext=DefaultContext(); optimize::Bool=true)
710+
function model_typed(
711+
model::Model,
712+
varinfo::AbstractVarInfo=VarInfo(model),
713+
context::AbstractContext=DefaultContext();
714+
optimize::Bool=true
715+
)
706716
args, kwargs = DynamicPPL.make_evaluate_args_and_kwargs(model, varinfo, context)
707717
return if isempty(kwargs)
708718
InteractiveUtils.@code_typed optimize=optimize model.f(args...)

0 commit comments

Comments
 (0)