Skip to content

Commit 16c597b

Browse files
committed
replace type hint by typed init of the sum
1 parent 6d9e3b2 commit 16c597b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/elbo.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ 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))::typeof(nlP0) # not type inferred in julia 1.10
249+
nlMs_sum = sum(f_col, 1:length(priorsM), init = zero(nlP0)) #::typeof(nlP0) # not type inferred in julia 1.10
250250
neg_log_prior_i = nlP0 - nlMs_sum
251251
if !isfinite(neg_log_prior_i)
252252
@show neg_log_prior_i, nlP0

0 commit comments

Comments
 (0)