diff options
author | Moritz Pflanzer <moritz.pflanzer@arm.com> | 2017-09-08 09:53:14 +0100 |
---|---|---|
committer | Anthony Barbier <anthony.barbier@arm.com> | 2018-11-02 16:35:24 +0000 |
commit | cde1e8adeacea5c33a1682ef7b05a0ef643463b8 (patch) | |
tree | 47e58abdf5bb6ef39db362a2ac777c93b3f76666 /tests/validation/fixtures/FullyConnectedLayerFixture.h | |
parent | 86b53339679e12c952a24a8845a5409ac3d52de6 (diff) | |
download | ComputeLibrary-cde1e8adeacea5c33a1682ef7b05a0ef643463b8.tar.gz |
COMPMID-415: Add tests for ConvolutionLayer reshaped weights
Change-Id: I6c1209a2afafccba2cbdbcda16aceb3ae0cc7b4b
Reviewed-on: http://mpd-gerrit.cambridge.arm.com/87000
Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com>
Reviewed-by: Gian Marco Iodice <gianmarco.iodice@arm.com>
Diffstat (limited to 'tests/validation/fixtures/FullyConnectedLayerFixture.h')
-rw-r--r-- | tests/validation/fixtures/FullyConnectedLayerFixture.h | 33 |
1 files changed, 1 insertions, 32 deletions
diff --git a/tests/validation/fixtures/FullyConnectedLayerFixture.h b/tests/validation/fixtures/FullyConnectedLayerFixture.h index d4d68f1af8..b19c40d5ea 100644 --- a/tests/validation/fixtures/FullyConnectedLayerFixture.h +++ b/tests/validation/fixtures/FullyConnectedLayerFixture.h @@ -34,6 +34,7 @@ #include "tests/framework/Asserts.h" #include "tests/framework/Fixture.h" #include "tests/validation/CPP/FullyConnectedLayer.h" +#include "tests/validation/CPP/Utils.h" #include "tests/validation/Helpers.h" #include <random> @@ -44,38 +45,6 @@ namespace test { namespace validation { -namespace -{ -RawTensor transpose(const RawTensor &src, int interleave = 1) -{ - // Create reference - TensorShape dst_shape(src.shape()); - dst_shape.set(0, src.shape().y() * interleave); - dst_shape.set(1, std::ceil(src.shape().x() / static_cast<float>(interleave))); - - RawTensor dst{ dst_shape, src.data_type() }; - - // Compute reference - uint8_t *out_ptr = dst.data(); - - for(int i = 0; i < dst.num_elements(); i += interleave) - { - Coordinates coord = index2coord(dst.shape(), i); - size_t coord_x = coord.x(); - coord.set(0, coord.y() * interleave); - coord.set(1, coord_x / interleave); - - const int num_elements = std::min<int>(interleave, src.shape().x() - coord.x()); - - std::copy_n(static_cast<const uint8_t *>(src(coord)), num_elements * src.element_size(), out_ptr); - - out_ptr += interleave * dst.element_size(); - } - - return dst; -} -} // namespace - template <typename TensorType, typename AccessorType, typename FunctionType, typename T, bool run_interleave> class FullyConnectedLayerValidationFixedPointFixture : public framework::Fixture { |