aboutsummaryrefslogtreecommitdiff
path: root/tests/validation/reference/FlattenLayer.cpp
diff options
context:
space:
mode:
authorGiorgio Arena <giorgio.arena@arm.com>2018-03-09 15:30:43 +0000
committerAnthony Barbier <anthony.barbier@arm.com>2018-11-02 16:49:16 +0000
commit156fcf3f36f6168e47d65db167bba3af5037e3d9 (patch)
tree89240783068a72b918791cf18a613eb43b93035d /tests/validation/reference/FlattenLayer.cpp
parent8de92619e223225aabdca873c02f231d8e941fd1 (diff)
downloadComputeLibrary-156fcf3f36f6168e47d65db167bba3af5037e3d9.tar.gz
COMPMID-802 Add NHWC data format support for NEON im2col.
Change-Id: I86e678179106a2b83d1c6a7cfe562df91b0f9eb2 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/124000 Tested-by: Jenkins <bsgcomp@arm.com> Reviewed-by: Pablo Tello <pablo.tello@arm.com>
Diffstat (limited to 'tests/validation/reference/FlattenLayer.cpp')
-rw-r--r--tests/validation/reference/FlattenLayer.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/tests/validation/reference/FlattenLayer.cpp b/tests/validation/reference/FlattenLayer.cpp
index 611701d8cf..44f4d93178 100644
--- a/tests/validation/reference/FlattenLayer.cpp
+++ b/tests/validation/reference/FlattenLayer.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017 ARM Limited.
+ * Copyright (c) 2017-2018 ARM Limited.
*
* SPDX-License-Identifier: MIT
*
@@ -34,12 +34,8 @@ namespace validation
namespace reference
{
template <typename T>
-SimpleTensor<T> flatten_layer(const SimpleTensor<T> &src)
+SimpleTensor<T> flatten_layer(const SimpleTensor<T> &src, const TensorShape &shape_flatten)
{
- TensorShape shape_flatten(src.shape());
- shape_flatten.set(0, src.shape()[0] * src.shape()[1] * src.shape()[2]);
- shape_flatten.remove_dimension(1);
- shape_flatten.remove_dimension(1);
SimpleTensor<T> dst(shape_flatten, src.data_type(), 1, src.fixed_point_position());
// Note: Since the reference implementation does not use padding bytes, we can copy directly the content of the source tensor
@@ -48,10 +44,10 @@ SimpleTensor<T> flatten_layer(const SimpleTensor<T> &src)
return dst;
}
-template SimpleTensor<float> flatten_layer(const SimpleTensor<float> &src);
-template SimpleTensor<half> flatten_layer(const SimpleTensor<half> &src);
-template SimpleTensor<qint8_t> flatten_layer(const SimpleTensor<qint8_t> &src);
-template SimpleTensor<qint16_t> flatten_layer(const SimpleTensor<qint16_t> &src);
+template SimpleTensor<float> flatten_layer(const SimpleTensor<float> &src, const TensorShape &shape_flatten);
+template SimpleTensor<half> flatten_layer(const SimpleTensor<half> &src, const TensorShape &shape_flatten);
+template SimpleTensor<qint8_t> flatten_layer(const SimpleTensor<qint8_t> &src, const TensorShape &shape_flatten);
+template SimpleTensor<qint16_t> flatten_layer(const SimpleTensor<qint16_t> &src, const TensorShape &shape_flatten);
} // namespace reference
} // namespace validation
} // namespace test