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

Function feed_forward

src/framework/modules/text_encoders/t5_base_encoder.cpp:145–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

143}
144
145core::TensorValue feed_forward(
146 core::ModuleBuildContext & ctx,
147 const core::TensorValue & input,
148 const T5BaseEncoderLayerWeights & weights,
149 const T5BaseEncoderConfig & config) {
150 auto hidden = LinearModule({config.hidden_size, config.intermediate_size, false, GGML_PREC_F32})
151 .build(ctx, input, weights.wi_proj);
152 hidden = ReluModule{}.build(ctx, hidden);
153 return LinearModule({config.intermediate_size, config.hidden_size, false, GGML_PREC_F32})
154 .build(ctx, hidden, weights.wo_proj);
155}
156
157core::TensorValue encoder_layer(
158 core::ModuleBuildContext & ctx,

Callers 1

encoder_layerFunction · 0.85

Calls 2

LinearModuleClass · 0.85
buildMethod · 0.45

Tested by

no test coverage detected