| 3405 | // ggml_cpy |
| 3406 | |
| 3407 | static 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 | |
| 3428 | struct ggml_tensor * ggml_cpy( |
| 3429 | struct ggml_context * ctx, |
no test coverage detected