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>
diff --git a/arm_compute/core/CL/kernels/CLPoolingLayerKernel.h b/arm_compute/core/CL/kernels/CLPoolingLayerKernel.h
index 14795d9..95acdf4 100644
--- a/arm_compute/core/CL/kernels/CLPoolingLayerKernel.h
+++ b/arm_compute/core/CL/kernels/CLPoolingLayerKernel.h
@@ -75,6 +75,7 @@
     const ICLTensor *_input;
     ICLTensor       *_output;
     PoolingLayerInfo _pool_info;
+    DataLayout       _data_layout;
     BorderSize       _border_size;
     unsigned int     _num_elems_processed_per_iteration;
 };
diff --git a/arm_compute/core/CL/kernels/CLScaleKernel.h b/arm_compute/core/CL/kernels/CLScaleKernel.h
index e1dea6c..4f8a3f0 100644
--- a/arm_compute/core/CL/kernels/CLScaleKernel.h
+++ b/arm_compute/core/CL/kernels/CLScaleKernel.h
@@ -75,6 +75,7 @@
 
 public:
     InterpolationPolicy _interpolationPolicy = InterpolationPolicy::BILINEAR;
+    DataLayout          _data_layout         = DataLayout::UNKNOWN;
 };
 } // namespace arm_compute
 #endif /*ARM_COMPUTE_CLSCALEKERNEL_H */
diff --git a/arm_compute/core/NEON/kernels/NEPoolingLayerKernel.h b/arm_compute/core/NEON/kernels/NEPoolingLayerKernel.h
index 47421ea..b36e10c 100644
--- a/arm_compute/core/NEON/kernels/NEPoolingLayerKernel.h
+++ b/arm_compute/core/NEON/kernels/NEPoolingLayerKernel.h
@@ -194,6 +194,7 @@
     const ITensor   *_input;
     ITensor         *_output;
     PoolingLayerInfo _pool_info;
+    DataLayout       _data_layout;
     unsigned int     _num_elems_processed_per_iteration;
     BorderSize       _border_size;
     bool             _is_square;