| 3702 | // ggml_mul_mat_id |
| 3703 | |
| 3704 | /* |
| 3705 | c = ggml_mul_mat_id(ctx, as, b, ids); |
| 3706 | |
| 3707 | as -> [cols, rows, n_expert] |
| 3708 | b -> [cols, n_expert_used, n_tokens] |
| 3709 | ids -> [n_expert_used, n_tokens] (i32) |
| 3710 | c -> [rows, n_expert_used, n_tokens] |
| 3711 | |
| 3712 | in b, n_expert_used can be broadcasted to match the n_expert_used of ids |
| 3713 | |
| 3714 | c ~= as[:,:,i] @ b[:,i%r,t], i = ids[e,t] for all e,t in ids |
| 3715 | */ |
| 3716 | struct ggml_tensor * ggml_mul_mat_id( |
| 3717 | struct ggml_context * ctx, |
| 3718 | struct ggml_tensor * as, |
| 3719 | struct ggml_tensor * b, |
| 3720 | struct ggml_tensor * ids) { |
| 3721 | GGML_ASSERT(!ggml_is_transposed(as)); |
| 3722 | GGML_ASSERT(ids->type == GGML_TYPE_I32); |
no test coverage detected