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

Function ggml_sqrt_impl

ggml.c:3531–3548  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3529// ggml_sqrt
3530
3531static struct ggml_tensor * ggml_sqrt_impl(
3532 struct ggml_context * ctx,
3533 struct ggml_tensor * a,
3534 bool inplace) {
3535 bool is_node = false;
3536
3537 if (!inplace && (a->grad)) {
3538 is_node = true;
3539 }
3540
3541 struct ggml_tensor * result = inplace ? ggml_view_tensor(ctx, a) : ggml_dup_tensor(ctx, a);
3542
3543 result->op = GGML_OP_SQRT;
3544 result->grad = is_node ? ggml_dup_tensor(ctx, result) : NULL;
3545 result->src[0] = a;
3546
3547 return result;
3548}
3549
3550struct ggml_tensor * ggml_sqrt(
3551 struct ggml_context * ctx,

Callers 2

ggml_sqrtFunction · 0.70
ggml_sqrt_inplaceFunction · 0.70

Calls 2

ggml_view_tensorFunction · 0.70
ggml_dup_tensorFunction · 0.70

Tested by

no test coverage detected