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

Function same_transformer_layer

src/models/stable_audio/same_autoencoder.cpp:297–311  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

295}
296
297core::TensorValue same_transformer_layer(
298 core::ModuleBuildContext & ctx,
299 const core::TensorValue & input,
300 const core::TensorValue & positions,
301 const core::TensorValue * attention_mask,
302 const StableAudioSameTransformerWeights & weights,
303 const StableAudioConfig & config,
304 bool sinusoidal) {
305 auto attn_in = dynamic_tanh_norm(ctx, input, weights.pre_norm);
306 auto attn = same_self_attention(ctx, attn_in, positions, attention_mask, weights.self_attn, config, input.shape.last_dim());
307 auto hidden = modules::AddModule{}.build(ctx, input, attn);
308 auto ff_in = dynamic_tanh_norm(ctx, hidden, weights.ff_norm);
309 auto ff = same_feed_forward(ctx, ff_in, weights.ff, sinusoidal);
310 return modules::AddModule{}.build(ctx, hidden, ff);
311}
312
313std::vector<float> adapt_interleaved_audio(
314 const runtime::AudioBuffer & audio,

Callers 4

build_decoder_blockMethod · 0.85
build_graph_outputMethod · 0.85

Calls 5

dynamic_tanh_normFunction · 0.85
same_self_attentionFunction · 0.85
same_feed_forwardFunction · 0.85
last_dimMethod · 0.80
buildMethod · 0.45

Tested by

no test coverage detected