File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -560,17 +560,21 @@ int command(int argc, const char *argv[]) {
560560 bool save_warmup
561561 = get_arg_val<bool_argument>(parser, " method" , " sample" , " save_warmup" );
562562
563+ list_argument *algo = dynamic_cast <list_argument *>(
564+ parser.arg (" method" )->arg (" sample" )->arg (" algorithm" ));
565+ std::string algo_name = algo->value ();
566+ bool use_fixed_param
567+ = model.num_params_r () == 0 || algo_name == " fixed_param" ;
568+
563569 bool adapt_engaged = get_arg_val<bool_argument>(parser, " method" , " sample" ,
564570 " adapt" , " engaged" );
565- if (adapt_engaged == true && num_warmup == 0 ) {
571+ if (!use_fixed_param && adapt_engaged == true && num_warmup == 0 ) {
566572 msg << " The number of warmup samples (num_warmup) must be greater than "
567573 << " zero if adaptation is enabled." << std::endl;
568574 throw std::invalid_argument (msg.str ());
569575 }
570- list_argument *algo = dynamic_cast <list_argument *>(
571- parser.arg (" method" )->arg (" sample" )->arg (" algorithm" ));
572- std::string algo_name = algo->value ();
573- if (model.num_params_r () == 0 || algo_name == " fixed_param" ) {
576+
577+ if (use_fixed_param) {
574578 if (algo_name != " fixed_param" ) {
575579 info (
576580 " Model contains no parameters, running fixed_param sampler, "
You can’t perform that action at this time.
0 commit comments