diff options
author | Sang-Hoon Park <sang-hoon.park@arm.com> | 2020-01-15 14:44:04 +0000 |
---|---|---|
committer | Georgios Pinitas <georgios.pinitas@arm.com> | 2020-01-28 16:05:27 +0000 |
commit | 11fedda86532cf632b9a3ae4b0f57e85f2a7c4f4 (patch) | |
tree | 6fd8003a38fe9baa262696754bdd5cb1d1595947 /examples/neon_cnn.cpp | |
parent | 6c89ffac750010cb9335794defe8a366c04db937 (diff) | |
download | ComputeLibrary-11fedda86532cf632b9a3ae4b0f57e85f2a7c4f4.tar.gz |
COMPMID-2985 add data_layout to PoolingLayerInfo
- use data layout from PoolingLayerInfo if it's available
- deprecate constructors without data_layout
- (3RDPARTY_UPDATE) modify examples and test suites to give data layout
Change-Id: Ie9ae8cc4837c339ff69a16a816110be704863c2d
Signed-off-by: Sang-Hoon Park <sang-hoon.park@arm.com>
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/2603
Reviewed-by: Michele Di Giorgio <michele.digiorgio@arm.com>
Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com>
Reviewed-by: Gian Marco Iodice <gianmarco.iodice@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'examples/neon_cnn.cpp')
-rw-r--r-- | examples/neon_cnn.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/examples/neon_cnn.cpp b/examples/neon_cnn.cpp index 6f26af7af4..ee6f46d28b 100644 --- a/examples/neon_cnn.cpp +++ b/examples/neon_cnn.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2018 ARM Limited. + * Copyright (c) 2016-2020 ARM Limited. * * SPDX-License-Identifier: MIT * @@ -131,6 +131,8 @@ public: const TensorShape out_shape_softmax(out_shape_fc0.x()); out_softmax.allocator()->init(TensorInfo(out_shape_softmax, 1, DataType::F32)); + constexpr auto data_layout = DataLayout::NCHW; + /* -----------------------End: [Initialize tensors] */ /* [Configure functions] */ @@ -142,7 +144,7 @@ public: act0.configure(&out_conv0, &out_act0, ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)); // in:32x32x8, out:16x16x8 (2x2 pooling), Pool type function: Max - pool0.configure(&out_act0, &out_pool0, PoolingLayerInfo(PoolingType::MAX, 2, PadStrideInfo(2 /* stride_x */, 2 /* stride_y */))); + pool0.configure(&out_act0, &out_pool0, PoolingLayerInfo(PoolingType::MAX, 2, data_layout, PadStrideInfo(2 /* stride_x */, 2 /* stride_y */))); // in:16x16x8: 3x3 convolution, 16 output features maps (OFM) conv1->configure(&out_pool0, &weights1, &biases1, &out_conv1, PadStrideInfo(1 /* stride_x */, 1 /* stride_y */, 1 /* pad_x */, 1 /* pad_y */)); @@ -151,7 +153,7 @@ public: act1.configure(&out_conv1, &out_act1, ActivationLayerInfo(ActivationLayerInfo::ActivationFunction::RELU)); // in:16x16x16, out:8x8x16 (2x2 pooling), Pool type function: Average - pool1.configure(&out_act1, &out_pool1, PoolingLayerInfo(PoolingType::AVG, 2, PadStrideInfo(2 /* stride_x */, 2 /* stride_y */))); + pool1.configure(&out_act1, &out_pool1, PoolingLayerInfo(PoolingType::AVG, 2, data_layout, PadStrideInfo(2 /* stride_x */, 2 /* stride_y */))); // in:8x8x16, out:128 fc0->configure(&out_pool1, &weights2, &biases2, &out_fc0); |