Skip to content

Commit accbe80

Browse files
committed
re-export setthreadsafe
1 parent 10a6438 commit accbe80

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

docs/src/api.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ even though [`Prior()`](@ref) is actually defined in the `Turing.Inference` modu
4343
| `prefix` | [`DynamicPPL.prefix`](@extref) | Prefix all variable names in a model with a given VarName |
4444
| `LogDensityFunction` | [`DynamicPPL.LogDensityFunction`](@extref) | A struct containing all information about how to evaluate a model. Mostly for advanced users |
4545
| `@addlogprob!` | [`DynamicPPL.@addlogprob!`](@extref) | Add arbitrary log-probability terms during model evaluation |
46+
| `setthreadsafe` | [`DynamicPPL.setthreadsafe`](@extref) | Mark a model as requiring threadsafe evaluation |
4647

4748
### Inference
4849

src/Turing.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ using DynamicPPL:
7676
@addlogprob!,
7777
InitFromPrior,
7878
InitFromUniform,
79-
InitFromParams
79+
InitFromParams,
80+
setthreadsafe
8081
using StatsBase: predict
8182
using OrderedCollections: OrderedDict
8283

@@ -91,6 +92,7 @@ export
9192
prefix,
9293
LogDensityFunction,
9394
@addlogprob!,
95+
setthreadsafe,
9496
# Sampling - AbstractMCMC
9597
sample,
9698
MCMCThreads,

test/mcmc/particle_mcmc.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ using Turing
8888
y[i] ~ Normal(x)
8989
end
9090
end
91-
model = DynamicPPL.setthreadsafe(f(randn(10)), true)
91+
model = setthreadsafe(f(randn(10)), true)
9292
@test_throws ArgumentError sample(model, SMC(), 100)
9393
end
9494
end
@@ -176,7 +176,7 @@ end
176176
y[i] ~ Normal(x)
177177
end
178178
end
179-
model = DynamicPPL.setthreadsafe(f(randn(10)), true)
179+
model = setthreadsafe(f(randn(10)), true)
180180
@test_throws ArgumentError sample(model, PG(10), 100)
181181
end
182182
end

0 commit comments

Comments
 (0)