| 249 | prefix + "." + std::to_string(layer), |
| 250 | storage_type, |
| 251 | hidden_size, |
| 252 | mlp_hidden_size)); |
| 253 | } |
| 254 | return blocks; |
| 255 | } |
| 256 | |
| 257 | HeartCodecFlowWeights load_flow_weights( |
| 258 | core::BackendWeightStore & store, |
| 259 | const assets::TensorSource & source, |
| 260 | const HeartCodecConfig & config, |
| 261 | assets::TensorStorageType storage_type) { |
| 262 | const int64_t estimator_dim = config.num_attention_heads * config.attention_head_dim; |
| 263 | const int64_t estimator_dim_2 = 2 * estimator_dim; |
| 264 | HeartCodecFlowWeights weights; |
| 265 | weights.vq_project_out = binding::linear_from_source( |
| 266 | store, |
| 267 | source, |
| 268 | "flow_matching.vq_embed.project_out", |
| 269 | storage_type, |
| 270 | config.dim, |
| 271 | config.codebook_dim, |
| 272 | true); |
| 273 | weights.vq_codebooks.reserve(static_cast<size_t>(config.num_quantizers)); |
no test coverage detected