| 295 | } |
| 296 | |
| 297 | core::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 | |
| 313 | std::vector<float> adapt_interleaved_audio( |
| 314 | const runtime::AudioBuffer & audio, |
no test coverage detected