Modify initialization for gather operation (#1666)
author최성진/동작제어Lab(SR)/Principal Engineer/삼성전자 <lotieye.choi@samsung.com>
Fri, 15 Jun 2018 01:24:16 +0000 (10:24 +0900)
committer서상민/동작제어Lab(SR)/Staff Engineer/삼성전자 <sangmin7.seo@samsung.com>
Fri, 15 Jun 2018 01:24:16 +0000 (10:24 +0900)
This commit modifies initialization for gather operation.
- initialize from 0, not 1.
- because gather indices' values should be within input data coverage.
- for example, suppose input data[300], 0=< indices data's value <299.

Signed-off-by: SungJin Choi <lotieye.choi@samsung.com>
libs/support/tflite/src/Diff.cpp

index 594f18e..14fac61 100644 (file)
@@ -269,10 +269,9 @@ int RandomTestRunner::run(const nnfw::support::tflite::interp::Builder &builder)
 
     nnfw::util::tensor::iterate(pure_view.shape()) << [&](const nnfw::util::tensor::Index &ind) {
       // TODO Generate random values
-      ++value;
-
       pure_view.at(ind) = value;
       nnapi_view.at(ind) = value;
+      ++value;
     };
   };