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

Function build_mlp

src/framework/modules/attention/qwen_decoder.cpp:188–204  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186 v_heads.tensor,
187 attention_mask.tensor,
188 1.0F / std::sqrt(static_cast<float>(dim)),
189 0.0F,
190 0.0F);
191 ggml_flash_attn_ext_set_prec(flash, precision);
192 return core::wrap_tensor(
193 flash,
194 core::TensorShape::from_dims({q_contiguous.shape.dims[0], q_contiguous.shape.dims[2], q_contiguous.shape.dims[1], dim}),
195 GGML_TYPE_F32);
196}
197
198core::TensorValue cache_view(
199 core::ModuleBuildContext & ctx,
200 const core::TensorValue & cache,
201 int64_t start,
202 int64_t steps,
203 int64_t heads,
204 int64_t dim) {
205 if (start < 0 || steps <= 0 || start + steps > cache.shape.dims[1]) {
206 throw std::runtime_error("Qwen decoder cache view range is invalid");
207 }

Callers 2

buildMethod · 0.70

Calls 3

LinearModuleClass · 0.85
require_linearFunction · 0.85
buildMethod · 0.45

Tested by

no test coverage detected