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

Function conditioning_from_codes

src/models/heartmula/codec.cpp:617–634  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

615 core::ModuleBuildContext & ctx,
616 const core::TensorValue & latents,
617 const HeartCodecScalarDecoderWeights & weights,
618 const HeartCodecConfig & config) {
619 auto x = quantize_scalar_latent(ctx, latents);
620 int64_t channels = config.init_channel * pow2_i64(config.upsample_factors.size());
621 x = modules::Conv1dModule({
622 config.latent_hidden_dim,
623 channels,
624 config.delay_kernel_size,
625 1,
626 static_cast<int>(config.delay_kernel_size / 2),
627 1,
628 weights.input_conv.bias.has_value(),
629 }).build(ctx, x, weights.input_conv);
630 constexpr int64_t dilations[] = {1, 3, 5, 7, 9};
631 for (size_t block_index = 0; block_index < weights.blocks.size(); ++block_index) {
632 const auto & block = weights.blocks[block_index];
633 const int64_t out_channels = channels / 2;
634 x = causal_conv_transpose1d(
635 ctx,
636 x,
637 block.up_conv,

Callers 1

Calls 6

reshape_codebook_indicesFunction · 0.85
LinearModuleClass · 0.85
validMethod · 0.80
buildMethod · 0.45

Tested by

no test coverage detected