Skip to content

Commit fcaff77

Browse files
committed
bugfix inv_gamma_lpdf
1 parent 3962c69 commit fcaff77

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

stan/math/opencl/prim/inv_gamma_lpdf.hpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,15 @@ return_type_t<T_y_cl, T_shape_cl, T_scale_cl> inv_gamma_lpdf(
105105
matrix_cl<double> beta_deriv_cl;
106106

107107
results(check_alpha_pos_finite, check_beta_pos_finite, check_y_not_nan,
108-
logp_cl, y_deriv_cl, alpha_deriv_cl, beta_deriv_cl)
109-
= expressions(alpha_pos_finite, beta_pos_finite, y_not_nan, logp_expr,
108+
any_y_nonpositive_cl, logp_cl, y_deriv_cl, alpha_deriv_cl,
109+
beta_deriv_cl)
110+
= expressions(alpha_pos_finite, beta_pos_finite, y_not_nan,
111+
any_y_nonpositive, logp_expr,
110112
calc_if<!is_constant<T_y_cl>::value>(y_deriv),
111113
calc_if<!is_constant<T_shape_cl>::value>(alpha_deriv),
112114
calc_if<!is_constant<T_scale_cl>::value>(beta_deriv));
113115

114-
if (from_matrix_cl(any_y_nonpositive).any()) {
116+
if (from_matrix_cl(any_y_nonpositive_cl).any()) {
115117
return LOG_ZERO;
116118
}
117119

0 commit comments

Comments
 (0)