[Tensor] Fix bug in the broadcast support
authorJihoon Lee <jhoon.it.lee@samsung.com>
Thu, 17 Sep 2020 10:43:48 +0000 (19:43 +0900)
committerjijoong.moon <jijoong.moon@samsung.com>
Wed, 23 Sep 2020 08:22:34 +0000 (17:22 +0900)
commit92c0e93c6b2dc2bf166b5b0e30c47f204b20e209
treedbe0854b5f5e3d82f5cdbdceb180c8a1656ec17b
parent7ca37f28bfe333226510e76306665b9f063496c3
[Tensor] Fix bug in the broadcast support

Fix bug that strides and buffer axis are miscalculated

**Changes proposed in this PR:**
- Clarified consecutive-one strategy and same-stride strategy
- Change last stride to 0 only if it is using consecutive-one strategy
- Add regression test

Resolves: #559

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Cc: Jijoong Moon <jijoong.moon@samsung.com>
Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
nntrainer/src/tensor.cpp
test/include/nntrainer_test_util.h
test/nntrainer_test_util.cpp
test/unittest/unittest_nntrainer_tensor.cpp