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

Function ggml_acc_or_set

ggml.c:15378–15385  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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)) {
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
15387static 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)) {

Callers 1

ggml_compute_backwardFunction · 0.70

Calls 4

ggml_hash_containsFunction · 0.70
ggml_scaleFunction · 0.70
ggml_new_f32Function · 0.70
ggml_acc_implFunction · 0.70

Tested by

no test coverage detected