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

Function encoder_layer

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

Source from the content-addressed store, hash-verified

155}
156
157core::TensorValue encoder_layer(
158 core::ModuleBuildContext & ctx,
159 const core::TensorValue & input,
160 const core::TensorValue & position_bias,
161 const core::TensorValue & additive_attention_mask,
162 const T5BaseEncoderLayerWeights & weights,
163 const T5BaseEncoderConfig & config) {
164 auto hidden = t5_layer_norm(ctx, input, weights.self_attention_layer_norm, config);
165 hidden = self_attention(ctx, hidden, position_bias, additive_attention_mask, weights, config);
166 auto output = AddModule{}.build(ctx, input, hidden);
167 hidden = t5_layer_norm(ctx, output, weights.ffn_layer_norm, config);
168 hidden = feed_forward(ctx, hidden, weights, config);
169 return AddModule{}.build(ctx, output, hidden);
170}
171
172} // namespace
173

Callers 1

buildMethod · 0.70

Calls 4

t5_layer_normFunction · 0.85
feed_forwardFunction · 0.85
self_attentionFunction · 0.70
buildMethod · 0.45

Tested by

no test coverage detected