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

Function ggml_cpy_impl

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

Source from the content-addressed store, hash-verified

3405// ggml_cpy
3406
3407static struct ggml_tensor * ggml_cpy_impl(
3408 struct ggml_context * ctx,
3409 struct ggml_tensor * a,
3410 struct ggml_tensor * b) {
3411 GGML_ASSERT(ggml_nelements(a) == ggml_nelements(b));
3412
3413 // make a view of the destination
3414 struct ggml_tensor * result = ggml_view_tensor(ctx, b);
3415 if (strlen(b->name) > 0) {
3416 ggml_format_name(result, "%s (copy of %s)", b->name, a->name);
3417 } else {
3418 ggml_format_name(result, "%s (copy)", a->name);
3419 }
3420
3421 result->op = GGML_OP_CPY;
3422 result->src[0] = a;
3423 result->src[1] = b;
3424
3425 return result;
3426}
3427
3428struct ggml_tensor * ggml_cpy(
3429 struct ggml_context * ctx,

Callers 1

ggml_cpyFunction · 0.85

Calls 3

ggml_nelementsFunction · 0.85
ggml_view_tensorFunction · 0.85
ggml_format_nameFunction · 0.85

Tested by

no test coverage detected