| 462 | } |
| 463 | |
| 464 | void copy_tensor_by_name(struct ggml_tensor * dst, struct ggml_context * ctx, const char * name) { |
| 465 | if (dst == NULL) { |
| 466 | return; |
| 467 | } |
| 468 | struct ggml_tensor * t = ggml_get_tensor(ctx, name); |
| 469 | GGML_ASSERT(are_same_layout(dst, t)); |
| 470 | memcpy(dst->data, t->data, ggml_nbytes(t)); |
| 471 | |
| 472 | if (strlen(ggml_get_name(dst)) == 0) { |
| 473 | ggml_set_name(dst, name); |
| 474 | } |
| 475 | } |
| 476 | |
| 477 | // gguf constants |
| 478 | static const char * LLM_KV_OPTIMIZER_TYPE = "optimizer.type"; |
no test coverage detected