| 325 | } |
| 326 | |
| 327 | core::TensorValue build_local_embedding( |
| 328 | core::ModuleBuildContext & ctx, |
| 329 | const core::TensorValue & x, |
| 330 | const core::TensorValue & local_add, |
| 331 | const StableAudioRfLayerWeights & weights, |
| 332 | const StableAudioConfig & config) { |
| 333 | auto local = modules::LinearModule({config.local_add_cond_dim, config.embed_dim, true, GGML_PREC_F32}) |
| 334 | .build(ctx, local_add, weights.local_embed_in); |
| 335 | local = modules::SiluModule{}.build(ctx, local); |
| 336 | local = modules::LinearModule({config.embed_dim, config.embed_dim, true, GGML_PREC_F32}) |
| 337 | .build(ctx, local, weights.local_embed_out); |
| 338 | auto prefix = modules::SliceModule({1, 0, config.num_memory_tokens}).build(ctx, x); |
| 339 | prefix = sub_tensor(ctx, prefix, prefix); |
| 340 | return modules::ConcatModule({1}).build(ctx, prefix, local); |
| 341 | } |
| 342 | |
| 343 | core::TensorValue build_rf_layer( |
| 344 | core::ModuleBuildContext & ctx, |
no test coverage detected