MCPcopy Create free account
hub / github.com/appdevforall/CodeOnTheGo / build_dense_out

Method build_dense_out

subprojects/llama.cpp/src/llama-graph.cpp:2312–2330  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2310}
2311
2312void llm_graph_context::build_dense_out(
2313 ggml_tensor * dense_2,
2314 ggml_tensor * dense_3) const {
2315 if (!cparams.embeddings || !(dense_2 || dense_3)) {
2316 return;
2317 }
2318 ggml_tensor * cur = res->t_embd_pooled != nullptr ? res->t_embd_pooled : res->t_embd;
2319 GGML_ASSERT(cur != nullptr && "missing t_embd_pooled/t_embd");
2320
2321 if (dense_2) {
2322 cur = ggml_mul_mat(ctx0, dense_2, cur);
2323 }
2324 if (dense_3) {
2325 cur = ggml_mul_mat(ctx0, dense_3, cur);
2326 }
2327 cb(cur, "result_embd_pooled", -1);
2328 res->t_embd_pooled = cur;
2329 ggml_build_forward_expand(gf, cur);
2330}
2331
2332
2333void llm_graph_context::build_pooling(

Callers 1

build_graphMethod · 0.80

Calls 2

ggml_mul_matFunction · 0.85

Tested by

no test coverage detected