diff options
author | Georgios Pinitas <georgios.pinitas@arm.com> | 2019-12-20 10:29:12 +0000 |
---|---|---|
committer | Georgios Pinitas <georgios.pinitas@arm.com> | 2019-12-20 11:55:08 +0000 |
commit | df9701960a296cb50523017a6d956d9bd59450f9 (patch) | |
tree | c7416361dfcaf612930fdc30b29a31a663994594 /src | |
parent | dcddcd2fc5bd1f07a23ad906ad24c3f53887d141 (diff) | |
download | ComputeLibrary-df9701960a296cb50523017a6d956d9bd59450f9.tar.gz |
COMPMID-2819: Retain data layout in NESpaceToDepth and NEDepthToSpace
Retain layout from configuration to execution as following configuration
might alter tensor meta-data in client code.
Signed-off-by: Georgios Pinitas <georgios.pinitas@arm.com>
Change-Id: Ifdbb285809956b966ea534ab3ab231911a307cc0
Reviewed-on: https://review.mlplatform.org/c/2512
Reviewed-by: Pablo Marquez <pablo.tello@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/core/NEON/kernels/NEDepthToSpaceLayerKernel.cpp | 7 | ||||
-rw-r--r-- | src/core/NEON/kernels/NESpaceToDepthLayerKernel.cpp | 8 |
2 files changed, 8 insertions, 7 deletions
diff --git a/src/core/NEON/kernels/NEDepthToSpaceLayerKernel.cpp b/src/core/NEON/kernels/NEDepthToSpaceLayerKernel.cpp index df631c3c03..98b0c106db 100644 --- a/src/core/NEON/kernels/NEDepthToSpaceLayerKernel.cpp +++ b/src/core/NEON/kernels/NEDepthToSpaceLayerKernel.cpp @@ -63,7 +63,7 @@ Status validate_arguments(const ITensorInfo *input, const ITensorInfo *output, i } // namespace NEDepthToSpaceLayerKernel::NEDepthToSpaceLayerKernel() - : _input(nullptr), _output(nullptr), _block_shape() + : _input(nullptr), _output(nullptr), _block_shape(), _data_layout(DataLayout::UNKNOWN) { } @@ -80,6 +80,7 @@ void NEDepthToSpaceLayerKernel::configure(const ITensor *input, ITensor *output, _input = input; _output = output; _block_shape = block_shape; + _data_layout = input->info()->data_layout(); // Configure kernel window Window win = calculate_max_window(*input->info(), Steps()); @@ -99,7 +100,7 @@ void NEDepthToSpaceLayerKernel::run(const Window &window, const ThreadInfo &info ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(this); ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(ICPPKernel::window(), window); - const int idx_channel = get_data_layout_dimension_index(_input->info()->data_layout(), DataLayoutDimension::CHANNEL); + const int idx_channel = get_data_layout_dimension_index(_data_layout, DataLayoutDimension::CHANNEL); const int depth_size = _input->info()->dimension(idx_channel); const int r = (depth_size / (_block_shape * _block_shape)); const int element_size = _input->info()->element_size(); @@ -112,7 +113,7 @@ void NEDepthToSpaceLayerKernel::run(const Window &window, const ThreadInfo &info slice_out.set(Window::DimZ, Window::Dimension(0, 0, 0)); // Main loop for NCHW and NHWC - if(_input->info()->data_layout() == DataLayout::NCHW) + if(_data_layout == DataLayout::NCHW) { Window slice_in = window.first_slice_window_2D(); do diff --git a/src/core/NEON/kernels/NESpaceToDepthLayerKernel.cpp b/src/core/NEON/kernels/NESpaceToDepthLayerKernel.cpp index 7b56c43994..ffd2dc14bf 100644 --- a/src/core/NEON/kernels/NESpaceToDepthLayerKernel.cpp +++ b/src/core/NEON/kernels/NESpaceToDepthLayerKernel.cpp @@ -66,7 +66,7 @@ Status validate_arguments(const ITensorInfo *input, const ITensorInfo *output, i } // namespace NESpaceToDepthLayerKernel::NESpaceToDepthLayerKernel() - : _input(nullptr), _output(nullptr), _block_shape(),_data_layout(DataLayout::UNKNOWN) + : _input(nullptr), _output(nullptr), _block_shape(), _data_layout(DataLayout::UNKNOWN) { } @@ -101,8 +101,8 @@ void NESpaceToDepthLayerKernel::run(const Window &window, const ThreadInfo &info ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL(this); ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW(ICPPKernel::window(), window); - const int channel_idx = get_data_layout_dimension_index(_data_layout, DataLayoutDimension::CHANNEL); - const int element_size = _input->info()->element_size(); + const int channel_idx = get_data_layout_dimension_index(_data_layout, DataLayoutDimension::CHANNEL); + const int element_size = _input->info()->element_size(); const size_t channel_size = _input->info()->dimension(channel_idx); @@ -111,7 +111,7 @@ void NESpaceToDepthLayerKernel::run(const Window &window, const ThreadInfo &info int batch_id = 0; // Main loop for NCHW and NHWC - if(_output->info()->data_layout() == DataLayout::NCHW) + if(_data_layout == DataLayout::NCHW) { do { |