diff --git a/Project.toml b/Project.toml index 6a7cda61b..ee4f20af7 100644 --- a/Project.toml +++ b/Project.toml @@ -12,6 +12,7 @@ Compat = "34da2185-b29b-5c13-b0c7-acf172513d20" ConstructionBase = "187b0558-2788-49d3-abe0-74a17ed4e7c9" Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" +EnzymeCore = "f151be2c-9106-41f4-ab19-57ee4f262869" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" LogDensityProblems = "6fdf6af0-433a-55f7-b3ed-c6c6e0b8df7c" MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" @@ -34,10 +35,11 @@ AbstractPPL = "0.6" BangBang = "0.3" Bijectors = "0.13" ChainRulesCore = "0.9.7, 0.10, 1" -ConstructionBase = "1.5.4" Compat = "4" +ConstructionBase = "1.5.4" Distributions = "0.23.8, 0.24, 0.25" DocStringExtensions = "0.8, 0.9" +EnzymeCore = "0.6" LogDensityProblems = "2" MCMCChains = "6" MacroTools = "0.5.6" diff --git a/src/contexts.jl b/src/contexts.jl index 83da5d929..e83da50cd 100644 --- a/src/contexts.jl +++ b/src/contexts.jl @@ -137,6 +137,9 @@ struct SamplingContext{S<:AbstractSampler,C<:AbstractContext,R} <: AbstractConte context::C end +using EnzymeCore +@inline EnzymeCore.EnzymeRules.inactive_type(::Type{T}) where {T <: SamplingContext} = true + function SamplingContext( rng::Random.AbstractRNG=Random.default_rng(), sampler::AbstractSampler=SampleFromPrior() )