From 4cffcb845a8ac4baddfc3be14bfa247c8da65c90 Mon Sep 17 00:00:00 2001 From: Cebtenzzre Date: Wed, 4 Oct 2023 14:02:14 -0400 Subject: [PATCH] rename is_float_eq -> is_float_close --- llama.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/llama.cpp b/llama.cpp index b8093da85a6b9..f3e9857981cf4 100644 --- a/llama.cpp +++ b/llama.cpp @@ -124,7 +124,7 @@ static void replace_all(std::string & s, const std::string & search, const std:: s = std::move(result); } -static bool is_float_eq(float a, float b, float abs_tol) { +static bool is_float_close(float a, float b, float abs_tol) { // Check for non-negative tolerance if (abs_tol < 0.0) { throw std::invalid_argument("Tolerance must be non-negative"); @@ -981,10 +981,10 @@ struct llama_hparams { const float EPSILON = 1e-9; - if (!is_float_eq(this->f_norm_eps, other.f_norm_eps, EPSILON)) return true; - if (!is_float_eq(this->f_norm_rms_eps, other.f_norm_rms_eps, EPSILON)) return true; - if (!is_float_eq(this->rope_freq_base_train, other.rope_freq_base_train, EPSILON)) return true; - if (!is_float_eq(this->rope_freq_scale_train, other.rope_freq_scale_train, EPSILON)) return true; + if (!is_float_close(this->f_norm_eps, other.f_norm_eps, EPSILON)) return true; + if (!is_float_close(this->f_norm_rms_eps, other.f_norm_rms_eps, EPSILON)) return true; + if (!is_float_close(this->rope_freq_base_train, other.rope_freq_base_train, EPSILON)) return true; + if (!is_float_close(this->rope_freq_scale_train, other.rope_freq_scale_train, EPSILON)) return true; return false; }