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

Function ggml_group_norm_impl

ggml.c:4035–4056  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4033// ggml_group_norm
4034
4035static struct ggml_tensor * ggml_group_norm_impl(
4036 struct ggml_context * ctx,
4037 struct ggml_tensor * a,
4038 int n_groups,
4039 bool inplace) {
4040
4041 bool is_node = false;
4042 if (!inplace && (a->grad)) {
4043 GGML_ASSERT(false); // TODO: implement backward
4044 is_node = true;
4045 }
4046
4047 struct ggml_tensor * result = inplace ? ggml_view_tensor(ctx, a) : ggml_dup_tensor(ctx, a);
4048
4049 result->op = GGML_OP_GROUP_NORM;
4050 result->op_params[0] = n_groups;
4051 result->grad = is_node ? ggml_dup_tensor(ctx, result) : NULL;
4052 result->src[0] = a;
4053 result->src[1] = NULL; // TODO: maybe store epsilon here?
4054
4055 return result;
4056}
4057
4058struct ggml_tensor * ggml_group_norm(
4059 struct ggml_context * ctx,

Callers 2

ggml_group_normFunction · 0.70
ggml_group_norm_inplaceFunction · 0.70

Calls 2

ggml_view_tensorFunction · 0.70
ggml_dup_tensorFunction · 0.70

Tested by

no test coverage detected