From 3ce3ff4e7133942e75fceae8f317104644d88bea Mon Sep 17 00:00:00 2001 From: Moritz Pflanzer Date: Fri, 21 Jul 2017 17:41:02 +0100 Subject: COMPMID-415: Move DepthConcatenateLayer to new validation Change-Id: I3e594d5800f563ba9af3195b7db2b6d3e32012dd Reviewed-on: http://mpd-gerrit.cambridge.arm.com/81340 Reviewed-by: Anthony Barbier Tested-by: Kaizen --- tests/validation/TensorOperations.h | 47 ------------------------------------- 1 file changed, 47 deletions(-) (limited to 'tests/validation/TensorOperations.h') diff --git a/tests/validation/TensorOperations.h b/tests/validation/TensorOperations.h index db145c19ad..84aa965a9f 100644 --- a/tests/validation/TensorOperations.h +++ b/tests/validation/TensorOperations.h @@ -999,53 +999,6 @@ void batch_normalization_layer(const Tensor &in, Tensor &out, const Tensor } } -// Depth Concatenate layer -template -void depth_concatenate_layer(const std::vector *> &srcs, Tensor &out) -{ - unsigned depth_offset = 0; - const int width_out = out.shape().x(); - const int height_out = out.shape().y(); - const int depth_out = out.shape().z(); - const int out_stride_z = width_out * height_out; - const int batches = out.shape().total_size_upper(3); - - // Set output tensor to 0 - memset(out.data(), 0, out.num_elements() * element_size_from_data_type(out.data_type())); - - for(unsigned int i = 0; i < srcs.size(); ++i) - { - ARM_COMPUTE_ERROR_ON(srcs[i] == nullptr); - ARM_COMPUTE_ERROR_ON(srcs[i]->data_type() != out.data_type()); - ARM_COMPUTE_ERROR_ON(depth_offset >= out.shape().z()); - ARM_COMPUTE_ERROR_ON(batches != static_cast(srcs[i]->shape().total_size_upper(3))); - - const Tensor *src = srcs[i]; - const int width = src->shape().x(); - const int height = src->shape().y(); - const int depth = src->shape().z(); - const unsigned int x_diff = (width_out - width) / 2; - const unsigned int y_diff = (height_out - height) / 2; - - const T *src_ptr = src->data(); - for(int b = 0; b < batches; ++b) - { - const unsigned int offset_to_first_element = b * out_stride_z * depth_out + depth_offset * out_stride_z - + y_diff * width_out + x_diff; - for(int d = 0; d < depth; ++d) - { - for(int r = 0; r < height; ++r) - { - std::copy(src_ptr, src_ptr + width, out.data() + offset_to_first_element + d * out_stride_z + r * width_out); - src_ptr += width; - } - } - } - - depth_offset += depth; - } -} - // Convolution layer template void convolution_layer(const Tensor &in, const Tensor &weights, const Tensor &bias, Tensor &out, const PadStrideInfo &conv_info) -- cgit v1.2.1