| 1573 | } |
| 1574 | |
| 1575 | ggml_tensor * llm_graph_context::build_pos_bias(ggml_tensor * pos_bucket, ggml_tensor * attn_rel_b) const { |
| 1576 | ggml_tensor * pos_bucket_1d = ggml_reshape_1d(ctx0, pos_bucket, pos_bucket->ne[0] * pos_bucket->ne[1]); |
| 1577 | cb(pos_bucket_1d, "pos_bucket_1d", -1); |
| 1578 | |
| 1579 | ggml_tensor * pos_bias = ggml_get_rows(ctx0, attn_rel_b, pos_bucket_1d); |
| 1580 | |
| 1581 | pos_bias = ggml_reshape_3d(ctx0, pos_bias, pos_bias->ne[0], pos_bucket->ne[0], pos_bucket->ne[1]); |
| 1582 | pos_bias = ggml_permute (ctx0, pos_bias, 2, 0, 1, 3); |
| 1583 | pos_bias = ggml_cont (ctx0, pos_bias); |
| 1584 | |
| 1585 | cb(pos_bias, "pos_bias", -1); |
| 1586 | |
| 1587 | return pos_bias; |
| 1588 | } |
| 1589 | |
| 1590 | ggml_tensor * llm_graph_context::build_attn_mha( |
| 1591 | ggml_tensor * q, |
nothing calls this directly
no test coverage detected