@@ -82,7 +82,8 @@ template <bool propto, typename T_x, typename T_alpha, typename T_beta,
8282 require_matrix_t <T_x>* = nullptr ,
8383 require_matrix_t <T_alpha>* = nullptr ,
8484 require_matrix_t <T_beta>* = nullptr ,
85- require_all_not_nonscalar_prim_or_rev_kernel_expression_t <T_x, T_alpha, T_beta>* = nullptr >
85+ require_all_not_nonscalar_prim_or_rev_kernel_expression_t <
86+ T_x, T_alpha, T_beta>* = nullptr >
8687inline return_type_t <T_x, T_alpha, T_beta> multinomial_logit_glm_lpmf (
8788 const std::vector<std::vector<int >>& y, T_x&& x, T_alpha&& alpha,
8889 T_beta&& beta) {
@@ -138,8 +139,7 @@ inline return_type_t<T_x, T_alpha, T_beta> multinomial_logit_glm_lpmf(
138139 }
139140
140141 // Row-max shift for numerical stability; cancels in log-softmax.
141- const auto exp_eta
142- = exp ((eta.colwise () - eta.rowwise ().maxCoeff ()));
142+ const auto exp_eta = exp ((eta.colwise () - eta.rowwise ().maxCoeff ()));
143143 const Array<eta_ret_t , Dynamic, Dynamic> softmax_mat
144144 = exp_eta.colwise () / exp_eta.rowwise ().sum ();
145145
@@ -167,7 +167,8 @@ inline return_type_t<T_x, T_alpha, T_beta> multinomial_logit_glm_lpmf(
167167 .eval ();
168168
169169 if constexpr (is_autodiff_v<T_x>) {
170- partials<0 >(ops_partials) = multiply (delta.matrix (), beta_val.transpose ());
170+ partials<0 >(ops_partials)
171+ = multiply (delta.matrix (), beta_val.transpose ());
171172 }
172173 if constexpr (is_autodiff_v<T_beta>) {
173174 partials<2 >(ops_partials) = multiply (x_val.transpose (), delta.matrix ());
@@ -184,7 +185,8 @@ inline return_type_t<T_x, T_alpha, T_beta> multinomial_logit_glm_lpmf(
184185}
185186
186187template <typename T_x, typename T_alpha, typename T_beta,
187- require_all_not_nonscalar_prim_or_rev_kernel_expression_t <T_x, T_alpha, T_beta>* = nullptr >
188+ require_all_not_nonscalar_prim_or_rev_kernel_expression_t <
189+ T_x, T_alpha, T_beta>* = nullptr >
188190inline return_type_t <T_x, T_alpha, T_beta> multinomial_logit_glm_lpmf (
189191 const std::vector<std::vector<int >>& y, T_x&& x, T_alpha&& alpha,
190192 T_beta&& beta) {
0 commit comments