MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / scaled_dimensions_signed

Function scaled_dimensions_signed

src/core/Utils.cpp:334–364  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

332}
333
334std::pair<int, int> scaled_dimensions_signed(
335 int width, int height, int kernel_width, int kernel_height, const PadStrideInfo &pad_stride_info)
336{
337 const int pad_left = pad_stride_info.pad_left();
338 const int pad_top = pad_stride_info.pad_top();
339 const int pad_right = pad_stride_info.pad_right();
340 const int pad_bottom = pad_stride_info.pad_bottom();
341 const int stride_x = pad_stride_info.stride().first;
342 const int stride_y = pad_stride_info.stride().second;
343 int w = 0;
344 int h = 0;
345 switch (pad_stride_info.round())
346 {
347 case DimensionRoundingType::FLOOR:
348 w = static_cast<int>(
349 std::floor((static_cast<float>(width + pad_left + pad_right - kernel_width) / stride_x) + 1));
350 h = static_cast<int>(
351 std::floor((static_cast<float>(height + pad_top + pad_bottom - kernel_height) / stride_y) + 1));
352 break;
353 case DimensionRoundingType::CEIL:
354 w = static_cast<int>(
355 std::ceil((static_cast<float>(width + pad_left + pad_right - kernel_width) / stride_x) + 1));
356 h = static_cast<int>(
357 std::ceil((static_cast<float>(height + pad_top + pad_bottom - kernel_height) / stride_y) + 1));
358 break;
359 default:
360 ARM_COMPUTE_ERROR("Unsupported rounding type");
361 }
362
363 return std::make_pair(static_cast<int>(w), static_cast<int>(h));
364}
365
366std::tuple<int, int, int> scaled_3d_dimensions_signed(int width,
367 int height,

Callers 3

compute_pool_shapeFunction · 0.85
validate_argumentsFunction · 0.85
validate_argumentsFunction · 0.85

Calls 8

floorFunction · 0.85
ceilFunction · 0.85
pad_leftMethod · 0.80
pad_topMethod · 0.80
pad_rightMethod · 0.80
pad_bottomMethod · 0.80
strideMethod · 0.45
roundMethod · 0.45

Tested by

no test coverage detected