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

Function scaled_3d_dimensions_signed

src/core/Utils.cpp:366–410  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

364}
365
366std::tuple<int, int, int> scaled_3d_dimensions_signed(int width,
367 int height,
368 int depth,
369 int kernel_width,
370 int kernel_height,
371 int kernel_depth,
372 const Pooling3dLayerInfo &pool3d_info)
373{
374 const int pad_left = pool3d_info.padding.left;
375 const int pad_top = pool3d_info.padding.top;
376 const int pad_right = pool3d_info.padding.right;
377 const int pad_bottom = pool3d_info.padding.bottom;
378 const int pad_front = pool3d_info.padding.front;
379 const int pad_back = pool3d_info.padding.back;
380 const int stride_x = pool3d_info.stride.x();
381 const int stride_y = pool3d_info.stride.y();
382 const int stride_z = pool3d_info.stride.z();
383 int w = 0;
384 int h = 0;
385 int d = 0;
386
387 switch (pool3d_info.round_type)
388 {
389 case DimensionRoundingType::FLOOR:
390 w = static_cast<int>(
391 std::floor((static_cast<float>(width + pad_left + pad_right - kernel_width) / stride_x) + 1));
392 h = static_cast<int>(
393 std::floor((static_cast<float>(height + pad_top + pad_bottom - kernel_height) / stride_y) + 1));
394 d = static_cast<int>(
395 std::floor((static_cast<float>(depth + pad_front + pad_back - kernel_depth) / stride_z) + 1));
396 break;
397 case DimensionRoundingType::CEIL:
398 w = static_cast<int>(
399 std::ceil((static_cast<float>(width + pad_left + pad_right - kernel_width) / stride_x) + 1));
400 h = static_cast<int>(
401 std::ceil((static_cast<float>(height + pad_top + pad_bottom - kernel_height) / stride_y) + 1));
402 d = static_cast<int>(
403 std::ceil((static_cast<float>(depth + pad_front + pad_back - kernel_depth) / stride_z) + 1));
404 break;
405 default:
406 ARM_COMPUTE_ERROR("Unsupported rounding type");
407 }
408
409 return std::make_tuple(static_cast<int>(w), static_cast<int>(h), static_cast<int>(d));
410}
411
412bool needs_serialized_reduction(ReductionOperation op, DataType dt, unsigned int axis)
413{

Callers 3

compute_pool3d_shapeFunction · 0.85
validate_argumentsFunction · 0.85
validate_argumentsFunction · 0.85

Calls 5

floorFunction · 0.85
ceilFunction · 0.85
xMethod · 0.45
yMethod · 0.45
zMethod · 0.45

Tested by

no test coverage detected