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

Function ggml_get_rows

subprojects/llama.cpp/ggml/src/ggml.c:3779–3800  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3777// ggml_get_rows
3778
3779struct ggml_tensor * ggml_get_rows(
3780 struct ggml_context * ctx,
3781 struct ggml_tensor * a,
3782 struct ggml_tensor * b) {
3783 GGML_ASSERT(a->ne[2] == b->ne[1]);
3784 GGML_ASSERT(a->ne[3] == b->ne[2]);
3785 GGML_ASSERT(b->ne[3] == 1);
3786 GGML_ASSERT(b->type == GGML_TYPE_I32);
3787
3788 // TODO: implement non F32 return
3789 enum ggml_type type = GGML_TYPE_F32;
3790 if (a->type == GGML_TYPE_I32) {
3791 type = a->type;
3792 }
3793 struct ggml_tensor * result = ggml_new_tensor_4d(ctx, type, a->ne[0], b->ne[0], b->ne[1], b->ne[2]);
3794
3795 result->op = GGML_OP_GET_ROWS;
3796 result->src[0] = a;
3797 result->src[1] = b;
3798
3799 return result;
3800}
3801
3802// ggml_get_rows_back
3803

Callers 15

buildMethod · 0.85
buildMethod · 0.85
buildMethod · 0.85
buildMethod · 0.85
weight_buft_supportedFunction · 0.85
build_moe_ffnMethod · 0.85
build_inp_embdMethod · 0.85

Calls 1

ggml_new_tensor_4dFunction · 0.85

Tested by 2

build_graphMethod · 0.68
build_graphMethod · 0.68