Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for default AutoForwardDiff #581

Merged
merged 4 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "DynamicPPL"
uuid = "366bfd00-2699-11ea-058f-f148b4cae6d8"
version = "0.24.7"
version = "0.24.8"

[deps]
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"
Expand Down
2 changes: 1 addition & 1 deletion ext/DynamicPPLForwardDiffExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function LogDensityProblemsAD.ADgradient(
ForwardDiff.Tag(f, eltype(θ))
end
chunk_size = getchunksize(ad)
chunk = if chunk_size == 0
chunk = if chunk_size == 0 || chunk_size === nothing
ForwardDiff.Chunk(θ)
else
ForwardDiff.Chunk(length(θ), chunk_size)
Expand Down
4 changes: 2 additions & 2 deletions src/context_implementations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ function dot_tilde_assume(context::AbstractContext, args...)
return dot_tilde_assume(NodeTrait(dot_tilde_assume, context), context, args...)
end
function dot_tilde_assume(rng, context::AbstractContext, args...)
return dot_tilde_assume(rng, NodeTrait(dot_tilde_assume, context), context, args...)
return dot_tilde_assume(NodeTrait(dot_tilde_assume, context), rng, context, args...)
end

function dot_tilde_assume(::IsLeaf, ::AbstractContext, right, left, vns, vi)
Expand All @@ -302,7 +302,7 @@ end
function dot_tilde_assume(::IsParent, context::AbstractContext, args...)
return dot_tilde_assume(childcontext(context), args...)
end
function dot_tilde_assume(rng, ::IsParent, context::AbstractContext, args...)
function dot_tilde_assume(::IsParent, rng, context::AbstractContext, args...)
return dot_tilde_assume(rng, childcontext(context), args...)
end

Expand Down
2 changes: 1 addition & 1 deletion test/ext/DynamicPPLForwardDiffExt.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@testset "tag" begin
for chunksize in (0, 1, 10)
for chunksize in (nothing, 0, 1, 10)
ad = ADTypes.AutoForwardDiff(; chunksize=chunksize)
standardtag = if !isdefined(Base, :get_extension)
DynamicPPL.DynamicPPLForwardDiffExt.standardtag
Expand Down
Loading