aboutsummaryrefslogtreecommitdiff
path: root/tests/validation/Reference.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/validation/Reference.cpp')
-rw-r--r--tests/validation/Reference.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/validation/Reference.cpp b/tests/validation/Reference.cpp
index 761bc20ea1..2388fb6fe3 100644
--- a/tests/validation/Reference.cpp
+++ b/tests/validation/Reference.cpp
@@ -30,6 +30,7 @@
#include "validation/Helpers.h"
#include <random>
+#include <vector>
using namespace arm_compute::test;
@@ -620,6 +621,28 @@ RawTensor Reference::compute_reference_pooling_layer(const TensorShape &shape_in
return ref_dst;
}
+RawTensor Reference::compute_reference_roi_pooling_layer(const TensorShape &shape, DataType dt, const std::vector<ROI> &rois, const ROIPoolingLayerInfo &pool_info)
+{
+ TensorShape shape_dst;
+ shape_dst.set(0, pool_info.pooled_width());
+ shape_dst.set(1, pool_info.pooled_height());
+ shape_dst.set(2, shape.z());
+ shape_dst.set(3, rois.size());
+
+ // Create reference
+ RawTensor ref_src = library->get(shape, dt);
+ RawTensor ref_dst = library->get(shape_dst, dt);
+
+ // Fill reference
+ std::uniform_real_distribution<> distribution(-1, 1);
+ library->fill(ref_src, distribution, 0.0);
+
+ // Compute reference
+ ReferenceCPP::roi_pooling_layer(ref_src, ref_dst, rois, pool_info);
+
+ return ref_dst;
+}
+
RawTensor Reference::compute_reference_softmax_layer(const TensorShape &shape, DataType dt, int fixed_point_position)
{
// Create reference