MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / load_layer

Function load_layer

src/models/stable_audio/rf_dit.cpp:467–498  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

465}
466
467StableAudioRfLayerWeights load_layer(
468 core::BackendWeightStore & store,
469 const assets::TensorSource & source,
470 const std::string & prefix,
471 const StableAudioConfig & config,
472 assets::TensorStorageType storage_type) {
473 StableAudioRfLayerWeights weights;
474 weights.pre_norm_gamma = store.load_f32_tensor(source, prefix + ".pre_norm.gamma", {config.embed_dim});
475 weights.cross_attend_norm_gamma = store.load_f32_tensor(source, prefix + ".cross_attend_norm.gamma", {config.embed_dim});
476 weights.ff_norm_gamma = store.load_f32_tensor(source, prefix + ".ff_norm.gamma", {config.embed_dim});
477 weights.self_attn = load_self_attention(store, source, prefix + ".self_attn", config, storage_type);
478 weights.cross_attn = load_cross_attention(store, source, prefix + ".cross_attn", config, storage_type);
479 weights.ff = load_feed_forward(store, source, prefix + ".ff", config, storage_type);
480 weights.local_embed_in = load_linear(
481 store,
482 source,
483 prefix + ".to_local_embed.0",
484 storage_type,
485 config.embed_dim,
486 config.local_add_cond_dim,
487 true);
488 weights.local_embed_out = load_linear(
489 store,
490 source,
491 prefix + ".to_local_embed.2",
492 storage_type,
493 config.embed_dim,
494 config.embed_dim,
495 true);
496 weights.scale_shift_gate = store.load_f32_tensor(source, prefix + ".to_scale_shift_gate", {6 * config.embed_dim});
497 return weights;
498}
499
500} // namespace
501

Callers 2

Calls 5

load_f32_tensorMethod · 0.80
load_self_attentionFunction · 0.70
load_cross_attentionFunction · 0.70
load_feed_forwardFunction · 0.70
load_linearFunction · 0.70

Tested by

no test coverage detected