Skip to content

Commit f9d3431

Browse files
committed
Fix the erroring test
1 parent 52dad64 commit f9d3431

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/ad.jl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,15 @@ using DynamicPPL.TestUtils.AD: run_ad, WithExpectedResult, NoTest
8282
t = 1:0.05:8
8383
σ = 0.3
8484
y = @. rand(sin(t) + Normal(0, σ))
85-
@model function state_space(y, TT, ::Type{T}=Float64) where {T}
85+
@model function state_space(y, TT)
8686
# Priors
8787
α ~ Normal(y[1], 0.001)
8888
τ ~ Exponential(1)
8989
η ~ filldist(Normal(0, 1), TT - 1)
9090
σ ~ Exponential(1)
91-
# create latent variable
92-
x = Vector{T}(undef, TT)
91+
# create latent variable -- Have to use typeof(α) here to ensure that
92+
# AD works fine. Not sure if this is a generally good workaround.
93+
x = Vector{typeof(α)}(undef, TT)
9394
x[1] = α
9495
for t in 2:TT
9596
x[t] = x[t - 1] + η[t - 1] * τ

0 commit comments

Comments
 (0)