Fix for Max_pool_float_* Gtest Failure (#2283)
authorShubham Gupta/System SW /SRI-Bangalore/Engineer/삼성전자 <shub98.gupta@samsung.com>
Tue, 14 Aug 2018 02:58:10 +0000 (08:28 +0530)
committer샤란/System SW /SRI-Bangalore/Staff Engineer/삼성전자 <sharan.allur@samsung.com>
Tue, 14 Aug 2018 02:58:10 +0000 (08:28 +0530)
This is fix for max_pool_float_*.Batches are now set correctly in arm_compute::tensorshape

Signed-off-by: Shubham <shub98.gupta@samsung.com>
runtimes/neurun/src/internal/Model.cc
runtimes/pure_arm_compute/src/internal/arm_compute/Cast.h

index 93fc365..015d8f4 100644 (file)
@@ -27,13 +27,12 @@ nnfw::util::feature::Shape Shape::asFeature(void) const
   //  - Dimension(1) -> Height
   //  - Dimension(2) -> Width
   //  - Dimension(3) -> Depth
-  assert(dim(0) == 1);
-
+  const auto batch = dim(0);
   const auto depth = dim(3);
   const auto height = dim(1);
   const auto width = dim(2);
 
-  return nnfw::util::feature::Shape(depth, height, width);
+  return nnfw::util::feature::Shape(batch, depth, height, width);
 }
 
 nnfw::util::kernel::Shape Shape::asKernel(void) const
index 35b07e9..4add3d7 100644 (file)
@@ -12,7 +12,7 @@
 
 ::arm_compute::TensorShape asTensorShape(const nnfw::util::feature::Shape &shape)
 {
-  return ::arm_compute::TensorShape(shape.W, shape.H, shape.C, 1);
+  return ::arm_compute::TensorShape(shape.W, shape.H, shape.C, shape.N);
 }
 
 ::arm_compute::TensorShape asTensorShape(const nnfw::util::kernel::Shape &shape)