diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2019-12-13 12:33:09 +0000 |
---|---|---|
committer | Pablo Marquez <pablo.tello@arm.com> | 2019-12-19 14:18:23 +0000 |
commit | 14d9d986c63eb8f07acec2f075383f9f4843ae1c (patch) | |
tree | 543b9fc7781f7e2deba0287fbacd69d27fd16840 /src/core/NEON | |
parent | d7d7e9035ca28b1b5200b20a73825397d46830fc (diff) | |
download | ComputeLibrary-14d9d986c63eb8f07acec2f075383f9f4843ae1c.tar.gz |
COMPMID-2819: Retain configuration step data layout to avoid side-effects.
Configuring functions serially can lead to side-effects in tensor
attributes. One of them is the data layout changing in case functions
share same IO tensors. Retain DataLayout used during configuration.
Change-Id: I17538ce08b86df6986f0fcf21fa6544fbd5bd74b
Signed-off-by: Georgios Pinitas <georgios.pinitas@arm.com>
Reviewed-on: https://review.mlplatform.org/c/2470
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Giorgio Arena <giorgio.arena@arm.com>
Diffstat (limited to 'src/core/NEON')
-rw-r--r-- | src/core/NEON/kernels/NEPoolingLayerKernel.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/core/NEON/kernels/NEPoolingLayerKernel.cpp b/src/core/NEON/kernels/NEPoolingLayerKernel.cpp index 4af5424a77..59c3543171 100644 --- a/src/core/NEON/kernels/NEPoolingLayerKernel.cpp +++ b/src/core/NEON/kernels/NEPoolingLayerKernel.cpp @@ -321,7 +321,7 @@ std::pair<Status, Window> validate_and_configure_window(ITensorInfo *input, ITen } // namespace NEPoolingLayerKernel::NEPoolingLayerKernel() - : _func(nullptr), _input(nullptr), _output(nullptr), _pool_info(), _num_elems_processed_per_iteration(0), _border_size(0), _is_square(false) + : _func(nullptr), _input(nullptr), _output(nullptr), _pool_info(), _data_layout(DataLayout::UNKNOWN), _num_elems_processed_per_iteration(0), _border_size(0), _is_square(false) { } @@ -364,14 +364,15 @@ void NEPoolingLayerKernel::configure(const ITensor *input, ITensor *output, cons ARM_COMPUTE_ERROR_THROW_ON(validate_arguments(input->info(), output->info(), pool_info, pooled_w, pooled_h)); // Set instance variables - _input = input; - _output = output; - _pool_info = pool_info; - _is_square = (pool_size.x() == pool_size.y()); + _input = input; + _output = output; + _pool_info = pool_info; + _data_layout = input->info()->data_layout(); + _is_square = (pool_size.x() == pool_size.y()); // Get data type const DataType data_type = input->info()->data_type(); - const bool is_nchw = data_layout == DataLayout::NCHW; + const bool is_nchw = _data_layout == DataLayout::NCHW; if(data_type == DataType::QASYMM8) { @@ -1846,7 +1847,7 @@ void NEPoolingLayerKernel::run(const Window &window, const ThreadInfo &info) const bool exclude_padding = _pool_info.exclude_padding(); Window window_input(window); - if(_input->info()->data_layout() == DataLayout::NCHW) + if(_data_layout == DataLayout::NCHW) { // Set step for input in x and y direction for the input unsigned int window_x_inc = 0; |