diff options
Diffstat (limited to 'src/core/Helpers.cpp')
-rw-r--r-- | src/core/Helpers.cpp | 171 |
1 files changed, 0 insertions, 171 deletions
diff --git a/src/core/Helpers.cpp b/src/core/Helpers.cpp index 6701ff4483..e692cc1e7c 100644 --- a/src/core/Helpers.cpp +++ b/src/core/Helpers.cpp @@ -25,162 +25,6 @@ namespace arm_compute { -Window calculate_max_window(const ValidRegion &valid_region, const Steps &steps, bool skip_border, BorderSize border_size) -{ - if(!skip_border) - { - border_size = BorderSize(0); - } - - const Coordinates &anchor = valid_region.anchor; - const TensorShape &shape = valid_region.shape; - - Window window; - - window.set(0, Window::Dimension( - // Skip the border left of the image - anchor[0] + border_size.left, - // Skip the border right of the image - // Make sure the window width is a multiple of the step size - anchor[0] + border_size.left + ceil_to_multiple(std::max(0, static_cast<int>(shape[0]) - static_cast<int>(border_size.left) - static_cast<int>(border_size.right)), steps[0]), - steps[0])); - - size_t n = 1; - - if(anchor.num_dimensions() > 1) - { - window.set(1, Window::Dimension( - // Skip the border above the image - anchor[1] + border_size.top, - // Skip the border below the image - anchor[1] + border_size.top + ceil_to_multiple(std::max(0, static_cast<int>(shape[1]) - static_cast<int>(border_size.top) - static_cast<int>(border_size.bottom)), steps[1]), - steps[1])); - - ++n; - } - - if(anchor.num_dimensions() > 2) - { - window.set(2, Window::Dimension(anchor[2], std::max<size_t>(1, shape[2]), steps[2])); - - ++n; - } - - for(; n < anchor.num_dimensions(); ++n) - { - window.set(n, Window::Dimension(anchor[n], std::max<size_t>(1, shape[n]))); - } - - for(; n < Coordinates::num_max_dimensions; ++n) - { - window.set(n, Window::Dimension(0, 1)); - } - - return window; -} - -Window calculate_max_enlarged_window(const ValidRegion &valid_region, const Steps &steps, BorderSize border_size) -{ - const Coordinates &anchor = valid_region.anchor; - const TensorShape &shape = valid_region.shape; - - Window window; - - window.set(0, Window::Dimension( - // move the anchor to the start from the border - anchor[0] - border_size.left, - // move the anchor to include the right end border - // Make sure the window width is a multiple of the step size - anchor[0] - border_size.left + ceil_to_multiple(shape[0] + border_size.left + border_size.right, steps[0]), - steps[0])); - - size_t n = 1; - - if(anchor.num_dimensions() > 1) - { - window.set(1, Window::Dimension( - // Include the border above the image - anchor[1] - border_size.top, - // Include the border below the image - anchor[1] - border_size.top + ceil_to_multiple(shape[1] + border_size.top + border_size.bottom, steps[1]), - steps[1])); - - ++n; - } - - if(anchor.num_dimensions() > 2) - { - window.set(2, Window::Dimension(0, std::max<size_t>(1, shape[n]), steps[2])); - - ++n; - } - - for(; n < anchor.num_dimensions(); ++n) - { - window.set(n, Window::Dimension(anchor[n], std::max<size_t>(1, shape[n]))); - } - - for(; n < Coordinates::num_max_dimensions; ++n) - { - window.set(n, Window::Dimension(0, 1)); - } - - return window; -} - -Window calculate_max_window_horizontal(const ValidRegion &valid_region, const Steps &steps, bool skip_border, BorderSize border_size) -{ - if(skip_border) - { - border_size.top = 0; - border_size.bottom = 0; - } - else - { - border_size.left = 0; - border_size.right = 0; - } - - const Coordinates &anchor = valid_region.anchor; - const TensorShape &shape = valid_region.shape; - - Window window; - - window.set(0, Window::Dimension( - // Skip the border left of the image - anchor[0] + border_size.left, - // Skip the border right of the image - // Make sure the window width is a multiple of the step size - anchor[0] + border_size.left + ceil_to_multiple(std::max(0, static_cast<int>(shape[0]) - static_cast<int>(border_size.left) - static_cast<int>(border_size.right)), steps[0]), - steps[0])); - - size_t n = 1; - - if(anchor.num_dimensions() > 1) - { - window.set(1, Window::Dimension( - // Skip the border above the image - anchor[1] - border_size.top, - // Skip the border below the image - anchor[1] + shape[1] + border_size.bottom, - 1)); - - ++n; - } - - for(; n < anchor.num_dimensions(); ++n) - { - window.set(n, Window::Dimension(anchor[n], std::max<size_t>(1, shape[n]))); - } - - for(; n < Coordinates::num_max_dimensions; ++n) - { - window.set(n, Window::Dimension(0, 1)); - } - - return window; -} - ValidRegion calculate_valid_region_scale(const ITensorInfo &src_info, const TensorShape &dst_shape, InterpolationPolicy interpolate_policy, SamplingPolicy sampling_policy, bool border_undefined) { @@ -256,19 +100,4 @@ ValidRegion calculate_valid_region_scale(const ITensorInfo &src_info, const Tens return valid_region; } - -PermutationVector get_permutation_vector_from_softmax_axis(size_t actual_axis) -{ - switch(actual_axis) - { - case 1: - return PermutationVector(1U, 0U, 2U, 3U); - case 2: - return PermutationVector(2U, 1U, 0U, 3U); - case 3: - return PermutationVector(3U, 1U, 2U, 0U); - default: - ARM_COMPUTE_ERROR("Axis not supported"); - } -} } // namespace arm_compute
\ No newline at end of file |