Skip to content

Commit f35eca6

Browse files
committed
Add @non_differentiable calls to work around Zygote limitations
1 parent 93ef3ee commit f35eca6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ext/DynamicPPLChainRulesCoreExt.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,10 @@ ChainRulesCore.@non_differentiable DynamicPPL.updategid!(
2424
# No need + causes issues for some AD backends, e.g. Zygote.
2525
ChainRulesCore.@non_differentiable DynamicPPL.infer_nested_eltype(x)
2626

27+
ChainRulesCore.@non_differentiable DynamicPPL.recontiguify_ranges!(ranges)
28+
# TODO(mhauru) A workaround for https://github.com/FluxML/Zygote.jl/issues/1523, remove when
29+
# fixed. Note that this is some serious type piracy. Needed because VarNamedVector uses
30+
# BitVectors.
31+
ChainRulesCore.@non_differentiable BitVector(a, b)
32+
2733
end # module

0 commit comments

Comments
 (0)