MCPcopy Create free account
hub / github.com/Tiiny-AI/PowerInfer / ggml_add_or_set

Function ggml_add_or_set

ggml.c:15370–15376  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15368// functions to change gradients considering the case that input a might be initial gradient with zero value
15369
15370static 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
15378static 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)) {

Callers 1

ggml_compute_backwardFunction · 0.70

Calls 2

ggml_hash_containsFunction · 0.70
ggml_add_implFunction · 0.70

Tested by

no test coverage detected