| 1444 | out.begin() + static_cast<std::ptrdiff_t>(q * length)); |
| 1445 | } |
| 1446 | return out; |
| 1447 | } |
| 1448 | |
| 1449 | void apply_inactive_conditioning( |
| 1450 | std::vector<float> & mu, |
| 1451 | int64_t frames, |
| 1452 | int64_t dim, |
| 1453 | int64_t latent_length, |
| 1454 | const std::vector<float> & zero_cond) { |
| 1455 | if (static_cast<int64_t>(mu.size()) != frames * dim || static_cast<int64_t>(zero_cond.size()) != dim) { |
| 1456 | throw std::runtime_error("HeartCodec conditioning mask shape mismatch"); |
| 1457 | } |
| 1458 | for (int64_t t = latent_length; t < frames; ++t) { |
| 1459 | std::copy( |
| 1460 | zero_cond.begin(), |
| 1461 | zero_cond.end(), |
| 1462 | mu.begin() + static_cast<std::ptrdiff_t>(t * dim)); |
| 1463 | } |
| 1464 | } |
| 1465 | |
| 1466 | std::vector<float> make_flow_input( |