aboutsummaryrefslogtreecommitdiff
path: root/tests/validation/TensorVisitors.h
diff options
context:
space:
mode:
authorGeorgios Pinitas <georgios.pinitas@arm.com>2017-07-05 17:02:25 +0100
committerAnthony Barbier <anthony.barbier@arm.com>2018-09-17 14:15:39 +0100
commitac4e873dad6aa6291fc36aff62047a896db04f6a (patch)
tree2c5397c6c04b97cedb88ff809f5d40cbe7dc79c9 /tests/validation/TensorVisitors.h
parentdf24618b53cffed1c574e11e9fd4ba7740f8c009 (diff)
downloadComputeLibrary-ac4e873dad6aa6291fc36aff62047a896db04f6a.tar.gz
COMPMID-417: Port DepthConcatenate to QS8/QS16 for NEON/CL.
Change-Id: I3dddae63043c7aa18d908a4fc8abacf3c64f98ca Reviewed-on: http://mpd-gerrit.cambridge.arm.com/80081 Tested-by: Kaizen <jeremy.johnson+kaizengerrit@arm.com> Reviewed-by: Steven Niu <steven.niu@arm.com>
Diffstat (limited to 'tests/validation/TensorVisitors.h')
-rw-r--r--tests/validation/TensorVisitors.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/validation/TensorVisitors.h b/tests/validation/TensorVisitors.h
index 723302c973..fcc584dd46 100644
--- a/tests/validation/TensorVisitors.h
+++ b/tests/validation/TensorVisitors.h
@@ -30,6 +30,8 @@
#include "boost_wrapper.h"
+#include <algorithm>
+#include <memory>
#include <ostream>
#include <vector>
@@ -253,7 +255,31 @@ private:
const TensorVariant &_bias;
PadStrideInfo _conv_info;
};
+// Depth Concatenate Layer visitor
+struct depth_concatenate_layer_visitor : public boost::static_visitor<>
+{
+public:
+ explicit depth_concatenate_layer_visitor(const std::vector<TensorVariant> &srcs)
+ : _srcs(srcs)
+ {
+ }
+ template <typename T>
+ void operator()(Tensor<T> &out) const
+ {
+ std::vector<const Tensor<T> *> srcs;
+ srcs.resize(_srcs.size());
+ std::transform(_srcs.begin(), _srcs.end(), srcs.begin(), [](const TensorVariant & t)
+ {
+ return &(boost::get<Tensor<T>>(t));
+ });
+ tensor_operations::depth_concatenate_layer(srcs, out);
+ }
+
+private:
+ const std::vector<TensorVariant> &_srcs;
+};
+// Fully Connected Layer visitor
struct fully_connected_layer_visitor : public boost::static_visitor<>
{
public: