From: 오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 Date: Fri, 25 Jan 2019 06:24:33 +0000 (+0900) Subject: Fix concat for not rank 4 (#4317) X-Git-Tag: submit/tizen/20190325.013700~313 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f0bf6241c636c05437981432a7fe2df3327d517d;p=platform%2Fcore%2Fml%2Fnnfw.git Fix concat for not rank 4 (#4317) Now concat operation rank is not 4 can run using cpu implementation Signed-off-by: Hyeongseok Oh --- diff --git a/runtimes/neurun/src/backend/acl_cl/kernel/ConcatLayer.cc b/runtimes/neurun/src/backend/acl_cl/kernel/ConcatLayer.cc index e8a438d..142e9c5 100644 --- a/runtimes/neurun/src/backend/acl_cl/kernel/ConcatLayer.cc +++ b/runtimes/neurun/src/backend/acl_cl/kernel/ConcatLayer.cc @@ -19,6 +19,7 @@ #include #include "util/feature/nchw/View.h" +#include "backend/acl_cl/Swizzle.h" #include "util/logging.h" namespace @@ -135,10 +136,12 @@ void ConcatLayer::configure( assert(axis < 4); + // TODO Handle when axis is negative + assert(axis >= 0); + // This map converts NHWC to NCHW(reversed) // NHWC -> WHCN - static const uint32_t axis_map[] = {3, 1, 0, 2}; - _axis = axis_map[axis]; + _axis = ToARMComputeAxis(output_alloc->num_dimensions(), axis).value(); // TODO Support Quant8 _input_type = OperandType::TENSOR_FLOAT32; diff --git a/tests/scripts/neurun_frameworktest_list.armv7l.acl_cl.txt b/tests/scripts/neurun_frameworktest_list.armv7l.acl_cl.txt index 4adc956..60d6e1e 100644 --- a/tests/scripts/neurun_frameworktest_list.armv7l.acl_cl.txt +++ b/tests/scripts/neurun_frameworktest_list.armv7l.acl_cl.txt @@ -1,8 +1,7 @@ add/1D add/4D average_pool_2d -concat/concat1 -concat/concat2 +concat conv_2d fullyconnected/fc1 max_pool_2d diff --git a/tests/scripts/neurun_frameworktest_list.armv7l.cpu.txt b/tests/scripts/neurun_frameworktest_list.armv7l.cpu.txt index 9c4e97d..91413e5 100644 --- a/tests/scripts/neurun_frameworktest_list.armv7l.cpu.txt +++ b/tests/scripts/neurun_frameworktest_list.armv7l.cpu.txt @@ -1,6 +1,5 @@ average_pool_2d -concat/concat1 -concat/concat2 +concat conv_2d fullyconnected/fc1 max_pool_2d diff --git a/tests/scripts/neurun_frameworktest_list.x86-64.cpu.txt b/tests/scripts/neurun_frameworktest_list.x86-64.cpu.txt index 9c4e97d..91413e5 100644 --- a/tests/scripts/neurun_frameworktest_list.x86-64.cpu.txt +++ b/tests/scripts/neurun_frameworktest_list.x86-64.cpu.txt @@ -1,6 +1,5 @@ average_pool_2d -concat/concat1 -concat/concat2 +concat conv_2d fullyconnected/fc1 max_pool_2d