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

Function ggml_view_impl

external/ggml/src/ggml.c:3704–3719  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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*/
3716struct 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);

Callers 4

ggml_view_1dFunction · 0.85
ggml_view_2dFunction · 0.85
ggml_view_3dFunction · 0.85
ggml_view_4dFunction · 0.85

Calls 3

ggml_new_tensor_implFunction · 0.85
ggml_format_nameFunction · 0.85
ggml_set_op_paramsFunction · 0.85

Tested by

no test coverage detected