| 4033 | // ggml_group_norm |
| 4034 | |
| 4035 | static 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 | |
| 4058 | struct ggml_tensor * ggml_group_norm( |
| 4059 | struct ggml_context * ctx, |
no test coverage detected