You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(EnzymeBugMWE) pkg> st Enzyme
Status `~/code/julia/misc/EnzymeBugMWE.jl/Project.toml`
[7da242da] Enzyme v0.11.1`https://github.com/EnzymeAD/Enzyme.jl.git#main`
(EnzymeBugMWE) pkg> st StaticArrays
Status `~/code/julia/misc/EnzymeBugMWE.jl/Project.toml`
[90137ffa] StaticArrays v1.5.24
julia>VERSIONv"1.9.0"
MWE
using StaticArrays
import Enzyme
const ω_DIMENSION =7_uni_prior(z::Real) =-log(5) -abs2(z /5)/2_uni_prior(z::AbstractVector) =sum(_uni_prior, z)
functionlog_posterior((; ω_intercept, ω_std))
ℓ_prior =_uni_prior(ω_intercept) +_uni_prior(ω_std)
ℓ_prior
endfunctiontransform_and_logjac(x)
S =eltype(x)
logjac::S=0.0
i::Int=0function_pick(d::Int)
v =@view x[(i+1):(i+d)]
i += d
v
end
ω_intercept =SVector{ω_DIMENSION}(_pick(ω_DIMENSION))
pre_ω_std =SVector{ω_DIMENSION}(_pick(ω_DIMENSION))
ω_std =exp.(pre_ω_std)
logjac +=sum(pre_ω_std)
(; ω_intercept, ω_std), logjac
endfunctionℓ(x)
θ, logjac =transform_and_logjac(x)
log_posterior(θ) + logjac
end
x =ones(2* ω_DIMENSION)
Enzyme.API.runtimeActivity!(true)
∂ℓ_∂x =zero(x)
_, y = Enzyme.autodiff(Enzyme.ReverseWithPrimal, ℓ, Enzyme.Active, Enzyme.Duplicated(x, ∂ℓ_∂x))
stacktrace
versions
MWE
(this is an off-shoot from debugging #817)
The text was updated successfully, but these errors were encountered: