| 3969 | // ggml_rms_norm |
| 3970 | |
| 3971 | static 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 | |
| 3993 | struct ggml_tensor * ggml_rms_norm( |
| 3994 | struct ggml_context * ctx, |
no test coverage detected