Refactor estimate_lambda()
This commit is contained in:
parent
17be7615ce
commit
b09662f86a
|
|
@ -982,8 +982,8 @@ static std::unordered_map<std::string, ggml_type> target_bpw_type(
|
||||||
double s2 = 0.0;
|
double s2 = 0.0;
|
||||||
for (int64_t j = 0; j < n_per_row; ++j) {
|
for (int64_t j = 0; j < n_per_row; ++j) {
|
||||||
const double w = v ? std::max(0.0f, v[j]) : 1.0;
|
const double w = v ? std::max(0.0f, v[j]) : 1.0;
|
||||||
const double aw2 = std::sqrt(w) * a[j];
|
const double aw = std::sqrt(w) * a[j];
|
||||||
const double z = aw2 * aw2;
|
const double z = aw * aw;
|
||||||
s1 += z;
|
s1 += z;
|
||||||
s2 += z * z;
|
s2 += z * z;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue