| 2310 | } |
| 2311 | |
| 2312 | void 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 | |
| 2333 | void llm_graph_context::build_pooling( |
no test coverage detected