Skip to content

Commit 9ca7846

Browse files
committed
revert to type hint
because init keyword does not work with Zygote.
1 parent 16c597b commit 9ca7846

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/elbo.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,9 @@ function compute_priors_logdensity(priorsP, priorsM, θP, θMs, zero_prior_logde
246246
#TRET = Base.return_types(logpdf_tv_sum, Tuple{typeof(priorsM[i]), typeof(θMs[:,i])})
247247
end
248248
end
249-
nlMs_sum = sum(f_col, 1:length(priorsM), init = zero(nlP0)) #::typeof(nlP0) # not type inferred in julia 1.10
249+
# init keyword does not work with Zygote
250+
#nlMs_sum = sum(f_col, 1:length(priorsM), init = zero(nlP0))
251+
nlMs_sum = sum(f_col, 1:length(priorsM))::typeof(nlP0) # not type inferred in julia 1.10
250252
neg_log_prior_i = nlP0 - nlMs_sum
251253
if !isfinite(neg_log_prior_i)
252254
@show neg_log_prior_i, nlP0

0 commit comments

Comments
 (0)