[neurun] Fix Shape4D in LowerInfo order (#3339)
author오형석/동작제어Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Thu, 25 Oct 2018 10:46:32 +0000 (19:46 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Thu, 25 Oct 2018 10:46:32 +0000 (19:46 +0900)
Fix Shape4D order bug (NHWC)

Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>
runtimes/neurun/src/graph/operand/Shape4DConvert.h

index b840d19..2825740 100644 (file)
@@ -34,16 +34,16 @@ inline LowerInfo::Shape4D asShape4D(const Shape &shape)
       return LowerInfo::Shape4D(1, 1, 1, 1);
 
     case 1u:
-      return LowerInfo::Shape4D(1, 1, 1, shape.dim(0));
+      return LowerInfo::Shape4D(shape.dim(0), 1, 1, 1);
 
     case 2u:
-      return LowerInfo::Shape4D(1, 1, shape.dim(1), shape.dim(0));
+      return LowerInfo::Shape4D(shape.dim(0), shape.dim(1), 1, 1);
 
     case 3u:
-      return LowerInfo::Shape4D(1, shape.dim(2), shape.dim(1), shape.dim(0));
+      return LowerInfo::Shape4D(shape.dim(0), shape.dim(1), shape.dim(2), 1);
 
     case 4u:
-      return LowerInfo::Shape4D(shape.dim(3), shape.dim(2), shape.dim(1), shape.dim(0));
+      return LowerInfo::Shape4D(shape.dim(0), shape.dim(1), shape.dim(2), shape.dim(3));
 
     default:
       throw "Unsupported rank > 4";