ggml : silu(-inf) should never happen

This commit is contained in:
Georgi Gerganov 2023-10-07 11:30:36 +03:00
parent bdbe11719d
commit 42833bc7a8
No known key found for this signature in database
GPG Key ID: 449E073F9DC10735

2
ggml.c
View File

@ -3923,8 +3923,6 @@ inline static void ggml_vec_gelu_quick_f32(const int n, float * y, const float *
// Sigmoid Linear Unit (SiLU) function // Sigmoid Linear Unit (SiLU) function
inline static float ggml_silu_f32(float x) { inline static float ggml_silu_f32(float x) {
if (x == -INFINITY) return 0.0f;
return x/(1.0f + expf(-x)); return x/(1.0f + expf(-x));
} }