ggml : add epsilon as a parameter for group_norm (#8818)

Signed-off-by: Molly Sophia <mollysophia379@gmail.com>
This commit is contained in:
Molly Sophia 2024-08-06 15:26:46 +08:00 committed by GitHub
parent cdd1889de6
commit 2d5dd7bb3f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 38 additions and 24 deletions

View file

@ -1140,16 +1140,17 @@ extern "C" {
// group normalize along ne0*ne1*n_groups
// used in stable-diffusion
// TODO: eps is hardcoded to 1e-6 for now
GGML_API struct ggml_tensor * ggml_group_norm(
struct ggml_context * ctx,
struct ggml_tensor * a,
int n_groups);
int n_groups,
float eps);
GGML_API struct ggml_tensor * ggml_group_norm_inplace(
struct ggml_context * ctx,
struct ggml_tensor * a,
int n_groups);
int n_groups,
float eps);
// a - x
// b - dy