From 760fda9798b68d8a66a97837fcbf0f2fdd1e7031 Mon Sep 17 00:00:00 2001 From: skykongkong8 Date: Fri, 23 Feb 2024 10:51:10 +0900 Subject: [PATCH] [ TensorV2 ] Apply changes made from ele-wise SIMD operations - Like commit#7363546, alpha option in ewva should be set to 1, not 0. - Change function name : ew* -> ele_* **Self evaluation:** 1. Build test: [X]Passed [ ]Failed [ ]Skipped 2. Run test: [X]Passed [ ]Failed [ ]Skipped Signed-off-by: skykongkong8 --- nntrainer/tensor/half_tensor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nntrainer/tensor/half_tensor.cpp b/nntrainer/tensor/half_tensor.cpp index d0e25b4bf4..f352177bda 100644 --- a/nntrainer/tensor/half_tensor.cpp +++ b/nntrainer/tensor/half_tensor.cpp @@ -510,8 +510,8 @@ TensorV2 &HalfTensor::add(TensorV2 const &m, TensorV2 &output, float const alpha) const { auto f = [&](const BroadcastInfoV2 &e, const _FP16 *buf, const _FP16 *m_buf, _FP16 *out_buf) { - if (e.strides[3] == 1 && strides[3] == 1 && strides[3] == 1 && alpha == 0) { - ewva(e.buffer_size, buf, m_buf, out_buf); + if (e.strides[3] == 1 && strides[3] == 1 && strides[3] == 1 && alpha == 1) { + ele_add(e.buffer_size, buf, m_buf, out_buf); } else { for (unsigned int i = 0; i < e.buffer_size; ++i) { *out_buf = *buf + *m_buf * static_cast<_FP16>(alpha);