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

Function convnext_block

src/models/miocodec/graph_ops.cpp:565–584  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

563}
564
565core::TensorValue convnext_block(
566 core::ModuleBuildContext & ctx,
567 const core::TensorValue & input_bct,
568 const MioCodecConvNeXtBlockWeights & weights) {
569 auto x = engine::modules::DepthwiseConv1dModule(weights.depthwise_conv_config).build(ctx, input_bct, weights.depthwise_conv);
570 x = engine::modules::TransposeModule({{0, 2, 1, 3}, x.shape.rank}).build(ctx, x);
571 x = engine::modules::LayerNormModule({384, 1.0e-6F, true, true}).build(ctx, x, weights.norm);
572 x = engine::modules::LinearModule({384, 1152, weights.pointwise_conv1.bias.has_value()}).build(
573 ctx,
574 x,
575 weights.pointwise_conv1);
576 x = engine::modules::GeluModule({engine::modules::GeluApproximation::ExactErf}).build(ctx, x);
577 x = engine::modules::LinearModule({1152, 384, weights.pointwise_conv2.bias.has_value()}).build(
578 ctx,
579 x,
580 weights.pointwise_conv2);
581 x = engine::modules::TransposeModule({{0, 2, 1, 3}, x.shape.rank}).build(ctx, x);
582 x = apply_gamma(ctx, x, weights.gamma, 384);
583 return engine::modules::ResidualAddModule{}.build(ctx, input_bct, x);
584}
585
586core::TensorValue global_encoder(
587 core::ModuleBuildContext & ctx,

Callers 1

global_encoderFunction · 0.85

Calls 7

TransposeModuleClass · 0.85
LayerNormModuleClass · 0.85
LinearModuleClass · 0.85
GeluModuleClass · 0.85
apply_gammaFunction · 0.85
buildMethod · 0.45

Tested by

no test coverage detected