MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / ggml_concat

Function ggml_concat

ggml.c:3737–3757  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3735// ggml_concat
3736
3737struct ggml_tensor * ggml_concat(
3738 struct ggml_context* ctx,
3739 struct ggml_tensor* a,
3740 struct ggml_tensor* b) {
3741 GGML_ASSERT(a->ne[0] == b->ne[0] && a->ne[1] == b->ne[1] && a->ne[3] == b->ne[3]);
3742
3743 bool is_node = false;
3744
3745 if (a->grad || b->grad) {
3746 is_node = true;
3747 }
3748
3749 struct ggml_tensor * result = ggml_new_tensor_4d(ctx, a->type, a->ne[0], a->ne[1], a->ne[2] + b->ne[2], a->ne[3]);
3750
3751 result->op = GGML_OP_CONCAT;
3752 result->grad = is_node ? ggml_dup_tensor(ctx, result) : NULL;
3753 result->src[0] = a;
3754 result->src[1] = b;
3755
3756 return result;
3757}
3758
3759// ggml_abs
3760

Callers 2

build_persimmonMethod · 0.70
build_stablelmMethod · 0.70

Calls 2

ggml_new_tensor_4dFunction · 0.70
ggml_dup_tensorFunction · 0.70

Tested by

no test coverage detected