Skip to content

Commit a020171

Browse files
authored
Fix for default AutoForwardDiff (#581)
* fix for default `AutoForwardDiff` * bump patch version * fixed bug in `dot_tilde_assume` * fixed another `dot_tilde_assume` argument ordering
1 parent abcf584 commit a020171

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "DynamicPPL"
22
uuid = "366bfd00-2699-11ea-058f-f148b4cae6d8"
3-
version = "0.24.7"
3+
version = "0.24.8"
44

55
[deps]
66
ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b"

ext/DynamicPPLForwardDiffExt.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function LogDensityProblemsAD.ADgradient(
2626
ForwardDiff.Tag(f, eltype(θ))
2727
end
2828
chunk_size = getchunksize(ad)
29-
chunk = if chunk_size == 0
29+
chunk = if chunk_size == 0 || chunk_size === nothing
3030
ForwardDiff.Chunk(θ)
3131
else
3232
ForwardDiff.Chunk(length(θ), chunk_size)

src/context_implementations.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ function dot_tilde_assume(context::AbstractContext, args...)
289289
return dot_tilde_assume(NodeTrait(dot_tilde_assume, context), context, args...)
290290
end
291291
function dot_tilde_assume(rng, context::AbstractContext, args...)
292-
return dot_tilde_assume(rng, NodeTrait(dot_tilde_assume, context), context, args...)
292+
return dot_tilde_assume(NodeTrait(dot_tilde_assume, context), rng, context, args...)
293293
end
294294

295295
function dot_tilde_assume(::IsLeaf, ::AbstractContext, right, left, vns, vi)
@@ -302,7 +302,7 @@ end
302302
function dot_tilde_assume(::IsParent, context::AbstractContext, args...)
303303
return dot_tilde_assume(childcontext(context), args...)
304304
end
305-
function dot_tilde_assume(rng, ::IsParent, context::AbstractContext, args...)
305+
function dot_tilde_assume(::IsParent, rng, context::AbstractContext, args...)
306306
return dot_tilde_assume(rng, childcontext(context), args...)
307307
end
308308

test/ext/DynamicPPLForwardDiffExt.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@testset "tag" begin
2-
for chunksize in (0, 1, 10)
2+
for chunksize in (nothing, 0, 1, 10)
33
ad = ADTypes.AutoForwardDiff(; chunksize=chunksize)
44
standardtag = if !isdefined(Base, :get_extension)
55
DynamicPPL.DynamicPPLForwardDiffExt.standardtag

0 commit comments

Comments
 (0)