| 1221 | ggml_gallocr_free(gallocr_); |
| 1222 | gallocr_ = nullptr; |
| 1223 | } |
| 1224 | throw std::runtime_error("failed to allocate HeartCodec scalar decoder graph"); |
| 1225 | } |
| 1226 | } |
| 1227 | const HeartCodecWeightsRuntime * runtime_ = nullptr; |
| 1228 | int64_t batch_size_ = 0; |
| 1229 | int64_t frames_ = 0; |
| 1230 | int64_t output_samples_ = 0; |
| 1231 | std::unique_ptr<ggml_context, GgmlContextDeleter> ctx_; |
| 1232 | ggml_tensor * input_ = nullptr; |
| 1233 | ggml_tensor * output_ = nullptr; |
| 1234 | ggml_cgraph * graph_ = nullptr; |
| 1235 | ggml_gallocr_t gallocr_ = nullptr; |
| 1236 | }; |
| 1237 | |
| 1238 | HeartCodecWeights load_heartcodec_weights( |
| 1239 | const HeartMuLaAssets & assets, |
| 1240 | ggml_backend_t backend, |
| 1241 | core::BackendType backend_type, |
| 1242 | size_t weight_context_bytes, |
| 1243 | assets::TensorStorageType weight_storage_type) { |
| 1244 | require_assets(assets); |
| 1245 | HeartCodecWeights weights; |
| 1246 | weights.store = std::make_shared<core::BackendWeightStore>( |
| 1247 | backend, |
nothing calls this directly
no test coverage detected