Skip to content

Commit

Permalink
[ TensorV2 ] Apply changes made from ele-wise SIMD operations
Browse files Browse the repository at this point in the history
- 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 <[email protected]>
  • Loading branch information
skykongkong8 committed Feb 23, 2024
1 parent b6d2914 commit 760fda9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nntrainer/tensor/half_tensor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 760fda9

Please sign in to comment.