auto rank = _ctx.at(pad_index).shape().dim(0);
auto pad_base = _ctx.at(pad_index).data().base();
- ::arm_compute::PaddingList padding_list;
- padding_list.resize(rank);
- for (int32_t n = 0; n < rank; ++n)
- {
- const int32_t *from = reinterpret_cast<const int32_t *>(pad_base) + (n * 2);
- auto axis = acl_common::ToARMComputeAxis(rank, n).value();
-
- padding_list[axis] = ::arm_compute::PaddingInfo{from[0], from[1]};
- }
auto input_type = _ctx.at(input_index).typeInfo();
auto data_type = acl_common::asDataType(input_type.type());
auto input = _tensor_builder->at(input_index).get()->handle();
auto output = _tensor_builder->at(output_index).get()->handle();
+ ::arm_compute::PaddingList padding_list;
+ padding_list.resize(rank);
+ for (int32_t n = 0; n < rank; ++n)
+ {
+
+ const int32_t *from = reinterpret_cast<const int32_t *>(pad_base) + (n * 2);
+
+ auto axis = acl_common::ToARMComputeAxis(rank, n).value();
+ auto fixed_axis = axis;
+ if (input->info()->num_dimensions() == 4 &&
+ input->info()->data_layout() == ::arm_compute::DataLayout::NCHW)
+ {
+ // CWHN -> WHCN
+ const int permutation[4] = {2, 0, 1, 3};
+ fixed_axis = permutation[fixed_axis];
+ }
+ padding_list[fixed_axis] = ::arm_compute::PaddingInfo{from[0], from[1]};
+ }
auto fn = nnfw::cpp14::make_unique<::arm_compute::CLPadLayer>();
fn->configure(input, output, padding_list, pixel_value);
export OP_BACKEND_Conv2DNode=cpu
export OP_BACKEND_MaxPool2DNode=acl_cl
export OP_BACKEND_AvgPool2DNode=acl_neon
-export ACL_DEFAULT_LAYOUT=NCHW
+export ACL_LAYOUT=NCHW
# Get the intersect of framework test list files(each backend has a lsit)
TESTLIST_PREFIX="tests/scripts/neurun_frameworktest_list.armv7l"