| 15376 | } |
| 15377 | |
| 15378 | 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, struct ggml_hash_set zero_table) { |
| 15379 | if (ggml_hash_contains(zero_table, a)) { |
| 15380 | struct ggml_tensor * a_zero = ggml_scale(ctx, a, ggml_new_f32(ctx, 0)); |
| 15381 | return ggml_acc_impl(ctx, a_zero, b, nb1, nb2, nb3, offset, false); |
| 15382 | } else { |
| 15383 | return ggml_acc_impl(ctx, a, b, nb1, nb2, nb3, offset, false); |
| 15384 | } |
| 15385 | } |
| 15386 | |
| 15387 | static struct ggml_tensor * ggml_add1_or_set(struct ggml_context * ctx, struct ggml_tensor * a, struct ggml_tensor * b, struct ggml_hash_set zero_table) { |
| 15388 | if (ggml_hash_contains(zero_table, a)) { |
no test coverage detected