[Bug] fix layout checking when calculating tensor size
authorDongju Chae <dongju.chae@samsung.com>
Thu, 12 Aug 2021 01:46:46 +0000 (10:46 +0900)
committer채동주/On-Device Lab(SR)/Staff Engineer/삼성전자 <dongju.chae@samsung.com>
Thu, 12 Aug 2021 05:30:28 +0000 (14:30 +0900)
This patch fixes layout checking when calculating tensor size.

Signed-off-by: Dongju Chae <dongju.chae@samsung.com>
src/core/ne-model.cc

index 8815a9b6605c9f436f8b531a4a0a95ce2c7e98b4..63a534e9666ae480524769d93c84a0f83462467d 100644 (file)
@@ -263,7 +263,7 @@ Metadata_v3::getInputTensorSize (uint32_t idx, data_layout layout) const {
     image = (depth == 1 || depth == 3);
 
     /** special handling for TRIV2 */
-    if (layout == DATA_LAYOUT_TRIV2 && depth % granularity != 0 && !image) {
+    if (depth % granularity != 0 && !image) {
       uint32_t new_depth;
 
       new_depth = (depth + granularity - 1) >> shift;
@@ -308,7 +308,7 @@ Metadata_v3::getOutputTensorSize (uint32_t idx, data_layout layout) const {
     granularity /= div;
 
     /** special handling for TRIV2 */
-    if (layout == DATA_LAYOUT_TRIV2 && depth % granularity != 0) {
+    if (depth % granularity != 0) {
       uint32_t new_depth;
 
       new_depth = (depth + granularity - 1) >> shift;