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

Function ggml_rms_norm_impl

ggml.c:3971–3991  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3969// ggml_rms_norm
3970
3971static struct ggml_tensor * ggml_rms_norm_impl(
3972 struct ggml_context * ctx,
3973 struct ggml_tensor * a,
3974 float eps,
3975 bool inplace) {
3976 bool is_node = false;
3977
3978 if (!inplace && (a->grad)) {
3979 is_node = true;
3980 }
3981
3982 struct ggml_tensor * result = inplace ? ggml_view_tensor(ctx, a) : ggml_dup_tensor(ctx, a);
3983
3984 ggml_set_op_params(result, &eps, sizeof(eps));
3985
3986 result->op = GGML_OP_RMS_NORM;
3987 result->grad = is_node ? ggml_dup_tensor(ctx, result) : NULL;
3988 result->src[0] = a;
3989
3990 return result;
3991}
3992
3993struct ggml_tensor * ggml_rms_norm(
3994 struct ggml_context * ctx,

Callers 2

ggml_rms_normFunction · 0.70
ggml_rms_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