aboutsummaryrefslogtreecommitdiff
path: root/tests/validation/ReferenceCPP.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/validation/ReferenceCPP.cpp')
-rw-r--r--tests/validation/ReferenceCPP.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/validation/ReferenceCPP.cpp b/tests/validation/ReferenceCPP.cpp
index c89b737598..105bfc4b6c 100644
--- a/tests/validation/ReferenceCPP.cpp
+++ b/tests/validation/ReferenceCPP.cpp
@@ -36,7 +36,9 @@
#include "boost_wrapper.h"
+#include <algorithm>
#include <functional>
+#include <memory>
#include <numeric>
#include <vector>
@@ -292,6 +294,19 @@ void ReferenceCPP::convolution_layer(const RawTensor &src, const RawTensor &weig
boost::apply_visitor(tensor_visitors::convolution_layer_visitor(s, w, b, conv_info), d);
}
+// Depth concatenate layer
+void ReferenceCPP::depth_concatenate_layer(const std::vector<std::unique_ptr<RawTensor>> &srcs, RawTensor &dst)
+{
+ std::vector<TensorVariant> ss;
+ ss.resize(srcs.size());
+ std::transform(srcs.begin(), srcs.end(), ss.begin(), [](std::unique_ptr<RawTensor> const & t)
+ {
+ return TensorFactory::get_tensor(*t);
+ });
+ TensorVariant d = TensorFactory::get_tensor(dst);
+ boost::apply_visitor(tensor_visitors::depth_concatenate_layer_visitor(ss), d);
+}
+
// Fully connected layer
void ReferenceCPP::fully_connected_layer(const RawTensor &src, const RawTensor &weights, const RawTensor &bias, RawTensor &dst)
{