File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -560,17 +560,20 @@ 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 = model.num_params_r () == 0 || algo_name == " fixed_param" ;
567+
563568 bool adapt_engaged = get_arg_val<bool_argument>(parser, " method" , " sample" ,
564569 " adapt" , " engaged" );
565- if (adapt_engaged == true && num_warmup == 0 ) {
570+ if (!use_fixed_param && adapt_engaged == true && num_warmup == 0 ) {
566571 msg << " The number of warmup samples (num_warmup) must be greater than "
567572 << " zero if adaptation is enabled." << std::endl;
568573 throw std::invalid_argument (msg.str ());
569574 }
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" ) {
575+
576+ if (use_fixed_param) {
574577 if (algo_name != " fixed_param" ) {
575578 info (
576579 " Model contains no parameters, running fixed_param sampler, "
You can’t perform that action at this time.
0 commit comments