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

Function ggml_concat

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

Source from the content-addressed store, hash-verified

2517// ggml_concat
2518
2519struct ggml_tensor * ggml_concat(
2520 struct ggml_context * ctx,
2521 struct ggml_tensor * a,
2522 struct ggml_tensor * b,
2523 int dim) {
2524 GGML_ASSERT(dim >= 0 && dim < GGML_MAX_DIMS);
2525 GGML_ASSERT(a->type == b->type);
2526
2527 int64_t ne[GGML_MAX_DIMS];
2528 for (int d = 0; d < GGML_MAX_DIMS; ++d) {
2529 if (d == dim) {
2530 ne[d] = a->ne[d] + b->ne[d];
2531 continue;
2532 }
2533 GGML_ASSERT(a->ne[d] == b->ne[d]);
2534 ne[d] = a->ne[d];
2535 }
2536
2537 struct ggml_tensor * result = ggml_new_tensor(ctx, a->type, GGML_MAX_DIMS, ne);
2538
2539 ggml_set_op_params_i32(result, 0, dim);
2540
2541 result->op = GGML_OP_CONCAT;
2542 result->src[0] = a;
2543 result->src[1] = b;
2544
2545 return result;
2546}
2547
2548// ggml_abs
2549

Callers 15

build_rope_2dMethod · 0.85
buildMethod · 0.85
buildMethod · 0.85
buildMethod · 0.85
buildMethod · 0.85
buildMethod · 0.85
buildMethod · 0.85
buildMethod · 0.85
buildMethod · 0.85
buildMethod · 0.85
llm_build_deepseek2Method · 0.85
llm_build_minicpm3Method · 0.85

Calls 2

ggml_new_tensorFunction · 0.85
ggml_set_op_params_i32Function · 0.85

Tested by 2

build_graphMethod · 0.68