From c8d89317c96c3ee08aa72992b308f52ea74ea5aa Mon Sep 17 00:00:00 2001 From: Xuan Son Nguyen Date: Wed, 9 Jul 2025 00:06:53 +0200 Subject: [PATCH] suggestions from coderabbit --- ggml/src/ggml-cann/ggml-cann.cpp | 2 +- ggml/src/ggml-cpu/vec.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ggml/src/ggml-cann/ggml-cann.cpp b/ggml/src/ggml-cann/ggml-cann.cpp index b60a83c5c6..55542ec45b 100755 --- a/ggml/src/ggml-cann/ggml-cann.cpp +++ b/ggml/src/ggml-cann/ggml-cann.cpp @@ -2210,7 +2210,7 @@ static bool ggml_backend_cann_supports_op(ggml_backend_dev_t dev, case GGML_OP_COUNT_EQUAL: return true; case GGML_OP_SCALE: - float bias = ((const float *)(dst->op_params))[1]; + float bias = ((const float *)(op->op_params))[1]; return bias == 0.0f; // TODO: support bias != 0.0f case GGML_OP_SOFT_MAX: // TODO: support broadcast diff --git a/ggml/src/ggml-cpu/vec.h b/ggml/src/ggml-cpu/vec.h index 78c7ed2d15..80f2eb550e 100644 --- a/ggml/src/ggml-cpu/vec.h +++ b/ggml/src/ggml-cpu/vec.h @@ -404,13 +404,13 @@ inline static void ggml_vec_mad1_f32(const int n, float * y, const float s, cons // leftovers for (int i = np; i < n; ++i) { - y[i] = y[i]*s + b; + y[i] = y[i]*s + b; } #endif #else // scalar for (int i = 0; i < n; ++i) { - y[i] *= y[i]*s + b; + y[i] = y[i]*s + b; } #endif }