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

Function ggml_get_rows_back

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

Source from the content-addressed store, hash-verified

3802// ggml_get_rows_back
3803
3804struct ggml_tensor * ggml_get_rows_back(
3805 struct ggml_context * ctx,
3806 struct ggml_tensor * a,
3807 struct ggml_tensor * b,
3808 struct ggml_tensor * c) {
3809 GGML_ASSERT(ggml_is_matrix(a) && ggml_is_vector(b) && b->type == GGML_TYPE_I32);
3810 GGML_ASSERT(ggml_is_matrix(c) && (a->ne[0] == c->ne[0]));
3811
3812 // TODO: implement non F32 return
3813 //struct ggml_tensor * result = ggml_new_tensor_2d(ctx, a->type, a->ne[0], b->ne[0]);
3814 struct ggml_tensor * result = ggml_new_tensor_2d(ctx, GGML_TYPE_F32, c->ne[0], c->ne[1]);
3815
3816 result->op = GGML_OP_GET_ROWS_BACK;
3817 result->src[0] = a;
3818 result->src[1] = b;
3819
3820 return result;
3821}
3822
3823// ggml_set_rows
3824

Callers 2

build_graphMethod · 0.85
ggml_compute_backwardFunction · 0.85

Calls 3

ggml_is_matrixFunction · 0.85
ggml_is_vectorFunction · 0.85
ggml_new_tensor_2dFunction · 0.85

Tested by 1

build_graphMethod · 0.68