| 15368 | // functions to change gradients considering the case that input a might be initial gradient with zero value |
| 15369 | |
| 15370 | static struct ggml_tensor * ggml_add_or_set(struct ggml_context * ctx, struct ggml_tensor * a, struct ggml_tensor * b, struct ggml_hash_set zero_table) { |
| 15371 | if (ggml_hash_contains(zero_table, a)) { |
| 15372 | return b; |
| 15373 | } else { |
| 15374 | return ggml_add_impl(ctx, a, b, false); |
| 15375 | } |
| 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)) { |
no test coverage detected