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

Function tokenizer_block

src/models/vibevoice/tokenizer_audio.cpp:719–740  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

717}
718
719core::TensorValue tokenizer_block(
720 core::ModuleBuildContext & ctx,
721 const core::TensorValue & input,
722 const VibeVoiceTokenizerBlockWeights & weights,
723 core::ConstantTensorCache & constants,
724 float eps) {
725 auto residual = input;
726 auto hidden = channel_rms_norm(ctx, input, weights.norm, constants, eps);
727 hidden = sconv_depthwise1d(ctx, hidden, weights.mixer, 1);
728 hidden = scale_channels(ctx, hidden, weights.gamma, constants);
729 hidden = modules::AddModule{}.build(ctx, residual, hidden);
730
731 residual = hidden;
732 hidden = channel_rms_norm(ctx, hidden, weights.ffn_norm, constants, eps);
733 hidden = modules::TransposeModule({{0, 2, 1, 3}, 3}).build(ctx, hidden);
734 hidden = linear(ctx, hidden, weights.ffn_linear1);
735 hidden = modules::GeluModule({modules::GeluApproximation::ExactErf}).build(ctx, hidden);
736 hidden = linear(ctx, hidden, weights.ffn_linear2);
737 hidden = modules::TransposeModule({{0, 2, 1, 3}, 3}).build(ctx, hidden);
738 hidden = scale_channels(ctx, hidden, weights.ffn_gamma, constants);
739 return modules::AddModule{}.build(ctx, residual, hidden);
740}
741
742core::TensorValue tokenizer_block_streaming(
743 core::ModuleBuildContext & ctx,

Callers 2

build_encoderFunction · 0.85
build_decoderFunction · 0.85

Calls 7

channel_rms_normFunction · 0.85
sconv_depthwise1dFunction · 0.85
scale_channelsFunction · 0.85
TransposeModuleClass · 0.85
GeluModuleClass · 0.85
linearFunction · 0.70
buildMethod · 0.45

Tested by

no test coverage detected