diff --git a/ggml.c b/ggml.c index 8af60f6fc..ef9e8585d 100644 --- a/ggml.c +++ b/ggml.c @@ -5909,10 +5909,10 @@ struct ggml_tensor * ggml_cpy_impl( // make a view of the destination struct ggml_tensor * result = ggml_view_tensor(ctx, b); - if (strlen(a->name) > 0) { - ggml_format_name(result, "%s (copy of %s)", a->name, b->name); + if (strlen(b->name) > 0) { + ggml_format_name(result, "%s (copy of %s)", b->name, a->name); } else { - ggml_format_name(result, "%s (copy)", b->name); + ggml_format_name(result, "%s (copy)", a->name); } result->op = GGML_OP_CPY;