fix ggml_acc_or_set to return tensor of correct shape
This commit is contained in:
parent
b1aa26f718
commit
a76e66ac8d
1 changed files with 2 additions and 1 deletions
3
ggml.c
3
ggml.c
|
@ -16255,7 +16255,8 @@ static struct ggml_tensor * ggml_add_or_set(struct ggml_context * ctx, struct gg
|
||||||
|
|
||||||
static struct ggml_tensor * ggml_acc_or_set(struct ggml_context * ctx, struct ggml_tensor * a, struct ggml_tensor * b, size_t nb1, size_t nb2, size_t nb3, size_t offset, void * zero_table[]) {
|
static struct ggml_tensor * ggml_acc_or_set(struct ggml_context * ctx, struct ggml_tensor * a, struct ggml_tensor * b, size_t nb1, size_t nb2, size_t nb3, size_t offset, void * zero_table[]) {
|
||||||
if (hash_contains(zero_table, a)) {
|
if (hash_contains(zero_table, a)) {
|
||||||
return b;
|
struct ggml_tensor * a_zero = ggml_scale(ctx, a, ggml_new_f32(ctx, 0));
|
||||||
|
return ggml_acc_impl(ctx, a_zero, b, nb1, nb2, nb3, offset, false);
|
||||||
} else {
|
} else {
|
||||||
return ggml_acc_impl(ctx, a, b, nb1, nb2, nb3, offset, false);
|
return ggml_acc_impl(ctx, a, b, nb1, nb2, nb3, offset, false);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue