From 8bab0ee5f44a0e2cfe60d4d9e040a2f5ae4ef9b1 Mon Sep 17 00:00:00 2001 From: Gian Marco Iodice Date: Thu, 13 Sep 2018 11:51:56 +0100 Subject: COMPMID-1584 - Collapse batch size in CLChannelShuffleLayerKernel COMPMID-1589 - Add support for NHWC to CLChannelShuffleLayerKernel Change-Id: I13936a5cd1659d01fdb10b346e90f0d72d79f1f1 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/148475 Tested-by: bsgcomp Reviewed-by: Michele DiGiorgio --- tests/validation/fixtures/ChannelShuffleLayerFixture.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'tests/validation/fixtures') diff --git a/tests/validation/fixtures/ChannelShuffleLayerFixture.h b/tests/validation/fixtures/ChannelShuffleLayerFixture.h index 9746480829..c9aae2dc17 100644 --- a/tests/validation/fixtures/ChannelShuffleLayerFixture.h +++ b/tests/validation/fixtures/ChannelShuffleLayerFixture.h @@ -46,9 +46,9 @@ class ChannelShuffleLayerValidationFixture : public framework::Fixture { public: template - void setup(TensorShape shape, unsigned int num_groups, DataType data_type) + void setup(TensorShape shape, unsigned int num_groups, DataType data_type, DataLayout data_layout) { - _target = compute_target(shape, data_type, num_groups); + _target = compute_target(shape, data_type, num_groups, data_layout); _reference = compute_reference(shape, data_type, num_groups); } @@ -59,11 +59,17 @@ protected: library->fill_tensor_uniform(tensor, 0); } - TensorType compute_target(const TensorShape &shape, DataType data_type, unsigned int num_groups) + TensorType compute_target(TensorShape shape, DataType data_type, unsigned int num_groups, DataLayout data_layout) { + // Note: The input shape passed to the function is always in NCHW + if(data_layout == DataLayout::NHWC) + { + permute(shape, PermutationVector(2U, 0U, 1U)); + } + // Create tensors - TensorType src = create_tensor(shape, data_type); - TensorType dst = create_tensor(shape, data_type); + TensorType src = create_tensor(shape, data_type, 1, QuantizationInfo(), data_layout); + TensorType dst; // Create and configure function FunctionType channel_shuffle_func; -- cgit v1.2.1