remove unnecessary src tensor from ggml_repeat & ggml_repeat_back

we don't need data of src[1] for computation, only to setup the correct output shape.
remove dependency on src[1], so that allocator can work more freely.

the computational graph is still completely determined, because the output shape is naturally included
This commit is contained in:
xaedes 2023-08-18 20:51:00 +02:00
parent 65b0561637
commit 3e47890760
No known key found for this signature in database
GPG key ID: 30030EDD817EA2B1

2
ggml.c
View file

@ -5593,7 +5593,6 @@ struct ggml_tensor * ggml_repeat(
result->op = GGML_OP_REPEAT; result->op = GGML_OP_REPEAT;
result->grad = is_node ? ggml_dup_tensor(ctx, result) : NULL; result->grad = is_node ? ggml_dup_tensor(ctx, result) : NULL;
result->src[0] = a; result->src[0] = a;
result->src[1] = b;
return result; return result;
} }
@ -5621,7 +5620,6 @@ struct ggml_tensor * ggml_repeat_back(
result->op = GGML_OP_REPEAT_BACK; result->op = GGML_OP_REPEAT_BACK;
result->grad = is_node ? ggml_dup_tensor(ctx, result) : NULL; result->grad = is_node ? ggml_dup_tensor(ctx, result) : NULL;
result->src[0] = a; result->src[0] = a;
result->src[1] = b;
return result; return result;
} }