Skip to content

Commit

Permalink
applied suggestions from @mhauru
Browse files Browse the repository at this point in the history
Co-authored-by: Markus Hauru <[email protected]>
  • Loading branch information
torfjelde and mhauru authored Dec 5, 2024
1 parent 17b6ec9 commit bfa88b2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
1 change: 0 additions & 1 deletion ext/DynamicPPLJETExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ function DynamicPPL.Experimental._determine_varinfo_jet(
)
# First we try with the typed varinfo.
varinfo = DynamicPPL.typed_varinfo(model, context)
issuccess = true

# Let's make sure that both evaluation and sampling doesn't result in type errors.
issuccess, result = DynamicPPL.Experimental.is_suitable_varinfo(
Expand Down
2 changes: 1 addition & 1 deletion src/DynamicPPL.jl
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ if !isdefined(Base, :get_extension)
using Requires
end

# Better error message if users forget to load the AD package
# Better error message if users forget to load JET
if isdefined(Base.Experimental, :register_error_hint)
function __init__()
Base.Experimental.register_error_hint(MethodError) do io, exc, argtypes, _
Expand Down
5 changes: 3 additions & 2 deletions src/experimental.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ module Experimental

using DynamicPPL: DynamicPPL

# This file only defines the names of the functions, and their docstrings. The actual implementations are in `ext/DynamicPPLJETExt.jl`, since we don't want to depend on JET.jl other than as a weak dependency.
"""
is_suitable_varinfo(model::Model, context::AbstractContext, varinfo::AbstractVarInfo; kwargs...)
Expand All @@ -11,7 +12,7 @@ Check if the `model` supports evaluation using the provided `context` and `varin
Loading JET.jl is required before calling this function.
# Arguments
- `model`: The model to to verify the support for.
- `model`: The model to verify the support for.
- `context`: The context to use for the model evaluation.
- `varinfo`: The varinfo to verify the support for.
Expand All @@ -28,7 +29,7 @@ function is_suitable_varinfo end
function _determine_varinfo_jet end

"""
determine_suitable_varinfo(model[, context]; verbose::Bool=false, only_ddpl::Bool=true)
determine_suitable_varinfo(model[, context]; only_ddpl::Bool=true)
Return a suitable varinfo for the given `model`.
Expand Down

0 comments on commit bfa88b2

Please sign in to comment.