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

Function ggml_cont_impl

ggml.c:4395–4413  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4393// ggml_cont
4394
4395static struct ggml_tensor * ggml_cont_impl(
4396 struct ggml_context * ctx,
4397 struct ggml_tensor * a,
4398 bool inplace) {
4399 bool is_node = false;
4400
4401 if (!inplace && a->grad) {
4402 is_node = true;
4403 }
4404
4405 struct ggml_tensor * result = inplace ? ggml_view_tensor(ctx, a) : ggml_dup_tensor(ctx, a);
4406 ggml_format_name(result, "%s (cont)", a->name);
4407
4408 result->op = GGML_OP_CONT;
4409 result->grad = is_node ? ggml_dup_tensor(ctx, result) : NULL;
4410 result->src[0] = a;
4411
4412 return result;
4413}
4414
4415struct ggml_tensor * ggml_cont(
4416 struct ggml_context * ctx,

Callers 2

ggml_contFunction · 0.70
ggml_cont_inplaceFunction · 0.70

Calls 3

ggml_view_tensorFunction · 0.70
ggml_dup_tensorFunction · 0.70
ggml_format_nameFunction · 0.70

Tested by

no test coverage detected