| 544 | const double fraction = x - floor_value; |
| 545 | int64_t rounded = static_cast<int64_t>(floor_value); |
| 546 | if (fraction > 0.5) { |
| 547 | ++rounded; |
| 548 | } else if (fraction == 0.5 && (rounded % 2) != 0) { |
| 549 | ++rounded; |
| 550 | } |
| 551 | return rounded; |
| 552 | } |
| 553 | |
| 554 | std::vector<float> apply_cfg_guidance( |
| 555 | const std::vector<float> & pred_cond, |
| 556 | const std::vector<float> & pred_uncond, |
| 557 | float guidance_scale) { |
| 558 | return engine::sampling::cfg_guidance(pred_cond, pred_uncond, guidance_scale); |
| 559 | } |
| 560 | |
| 561 | std::vector<float> apply_apg_guidance( |
| 562 | const std::vector<float> & pred_cond, |
| 563 | const std::vector<float> & pred_uncond, |
| 564 | float guidance_scale, |
| 565 | int64_t frames, |
| 566 | int64_t channels, |