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

Function build_residual_unit

src/models/ace_step/vae_decoder.cpp:538–552  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

536}
537
538core::TensorValue build_residual_unit(
539 core::ModuleBuildContext & ctx,
540 const core::TensorValue & input,
541 const ResidualUnitWeights & weights,
542 int64_t channels,
543 int dilation) {
544 auto hidden = build_snake1d_exact_bct(ctx, input, weights.snake1, channels);
545 auto conv1 = weights.conv1;
546 conv1.dilation = dilation;
547 conv1.padding = 3 * dilation;
548 hidden = build_conv1d(ctx, hidden, conv1, channels, channels, true);
549 hidden = build_snake1d_exact_bct(ctx, hidden, weights.snake2, channels);
550 hidden = build_conv1d(ctx, hidden, weights.conv2, channels, channels, true);
551 return modules::AddModule{}.build(ctx, input, hidden);
552}
553
554int64_t audio_frames_per_latent(const AceStepVAEConfig & config) {
555 if (config.downsampling_ratios.empty()) {

Callers 2

buildMethod · 0.70
build_encoder_blockFunction · 0.70

Calls 3

build_snake1d_exact_bctFunction · 0.85
build_conv1dFunction · 0.85
buildMethod · 0.45

Tested by

no test coverage detected