From ad883341c8bffd7ea3ab7299f991067d4655ab22 Mon Sep 17 00:00:00 2001 From: William Moses Date: Thu, 12 Sep 2024 05:41:38 -0400 Subject: [PATCH] Mark istrans as inactive (#658) * Mark istrans as inactive * Update DynamicPPLEnzymeCoreExt.jl * Update DynamicPPLEnzymeCoreExt.jl * Expand Enzyme extension comment --------- Co-authored-by: Markus Hauru --- ext/DynamicPPLEnzymeCoreExt.jl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ext/DynamicPPLEnzymeCoreExt.jl b/ext/DynamicPPLEnzymeCoreExt.jl index f83d6e8f7..ceb3f4981 100644 --- a/ext/DynamicPPLEnzymeCoreExt.jl +++ b/ext/DynamicPPLEnzymeCoreExt.jl @@ -10,4 +10,9 @@ end @inline EnzymeCore.EnzymeRules.inactive_type(::Type{<:DynamicPPL.SamplingContext}) = true +# Mark istrans as having 0 derivative. The `nothing` return value is not significant, Enzyme +# only checks whether such a method exists, and never runs it. +@inline EnzymeCore.EnzymeRules.inactive_noinl(::typeof(DynamicPPL.istrans), args...) = + nothing + end