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

Function ggml_norm_impl

ggml.c:3932–3953  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3930// ggml_norm
3931
3932static struct ggml_tensor * ggml_norm_impl(
3933 struct ggml_context * ctx,
3934 struct ggml_tensor * a,
3935 float eps,
3936 bool inplace) {
3937 bool is_node = false;
3938
3939 if (!inplace && (a->grad)) {
3940 GGML_ASSERT(false); // TODO: implement backward
3941 is_node = true;
3942 }
3943
3944 struct ggml_tensor * result = inplace ? ggml_view_tensor(ctx, a) : ggml_dup_tensor(ctx, a);
3945
3946 ggml_set_op_params(result, &eps, sizeof(eps));
3947
3948 result->op = GGML_OP_NORM;
3949 result->grad = is_node ? ggml_dup_tensor(ctx, result) : NULL;
3950 result->src[0] = a;
3951
3952 return result;
3953}
3954
3955struct ggml_tensor * ggml_norm(
3956 struct ggml_context * ctx,

Callers 2

ggml_normFunction · 0.70
ggml_norm_inplaceFunction · 0.70

Calls 3

ggml_view_tensorFunction · 0.70
ggml_dup_tensorFunction · 0.70
ggml_set_op_paramsFunction · 0.70

Tested by

no test coverage detected