Skip to content

Commit bfbf727

Browse files
committed
Add getadtype function
1 parent 3fffd3e commit bfbf727

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ uuid = "80f14c24-f653-4e6a-9b94-39d6b0f70001"
33
keywords = ["markov chain monte carlo", "probabilistic programming"]
44
license = "MIT"
55
desc = "A lightweight interface for common MCMC methods."
6-
version = "5.6.1"
6+
version = "5.7.0"
77

88
[deps]
99
BangBang = "198e06fe-97b7-11e9-32a5-e1d131e6ad66"

src/interface.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,16 @@ then `reduce(chainscat, c)` is called.
1919
chainsstack(c) = c
2020
chainsstack(c::AbstractVector{<:AbstractChains}) = reduce(chainscat, c)
2121

22+
"""
23+
getadtype(sampler::AbstractSampler)
24+
25+
If the sampler specifies an automatic differentiation (AD) backend to use, this
26+
function should return the corresponding `ADTypes.AbstractADType`.
27+
28+
By default, this returns `nothing`.
29+
"""
30+
getadtype(::AbstractSampler) = nothing
31+
2232
"""
2333
bundle_samples(samples, model, sampler, state, chain_type[; kwargs...])
2434

0 commit comments

Comments
 (0)