| 122 | out.insert(out.end(), residual.begin(), residual.end()); |
| 123 | return out; |
| 124 | } |
| 125 | |
| 126 | void append_patch(std::vector<float> &features, const std::vector<float> &patch, |
| 127 | int64_t expected_size) { |
| 128 | if (static_cast<int64_t>(patch.size()) != expected_size) { |
| 129 | throw std::runtime_error("VoxCPM2 generated patch size mismatch"); |
| 130 | } |
| 131 | features.insert(features.end(), patch.begin(), patch.end()); |
| 132 | } |
| 133 | |
| 134 | void validate_feature_block(const std::vector<float> &features, int64_t patches, |
| 135 | int64_t patch_elems, const char *label) { |
| 136 | if (patches < 0) { |
| 137 | throw std::runtime_error(std::string("VoxCPM2 ") + label + |
no test coverage detected