| 143 | } |
| 144 | |
| 145 | core::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 | |
| 157 | core::TensorValue encoder_layer( |
| 158 | core::ModuleBuildContext & ctx, |
no test coverage detected