[neurun] Remove NDEBUG in planTensors (#3579)
author김용섭/동작제어Lab(SR)/Engineer/삼성전자 <yons.kim@samsung.com>
Wed, 14 Nov 2018 08:21:56 +0000 (17:21 +0900)
committer오형석/동작제어Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Wed, 14 Nov 2018 08:21:56 +0000 (17:21 +0900)
* [neurun] Remove NDEBUG in planTensors

Removes NDEBUG code in Linear::planTensors.

Signed-off-by: Yongseop Kim <yons.kim@samsung.com>
* Fix format-checker failed

runtimes/neurun/src/linear/Linear.cc

index 2f97731..f1cbfe6 100644 (file)
@@ -14,6 +14,8 @@
  * limitations under the License.
  */
 
+#include <algorithm>
+
 #include "Linear.h"
 
 #include "graph/Graph.h"
@@ -173,11 +175,9 @@ backend::TensorBuilderSet Linear::planTensors()
     }
   }
 
-#ifndef NDEBUG
   // Now, model outputs should be not deallocated
-  for (const auto &ind : _graph.getOutputs())
-    assert(uses_map[ind] > 0);
-#endif
+  assert(std::all_of(_graph.getOutputs().begin(), _graph.getOutputs().end(),
+                     [&uses_map](const graph::operand::Index &ind) { return uses_map[ind] > 0; }));
 
   // Set subtensor information
   // Todo: move this phase outside as optimization phase