| 46 | namespace |
| 47 | { |
| 48 | inline std::tuple<float, float> |
| 49 | calculate_scale_factors(const ITensorInfo *src, const ITensorInfo *dst, DataLayout data_layout, bool align_corners) |
| 50 | { |
| 51 | const int idx_width = get_data_layout_dimension_index(data_layout, DataLayoutDimension::WIDTH); |
| 52 | const int idx_height = get_data_layout_dimension_index(data_layout, DataLayoutDimension::HEIGHT); |
| 53 | |
| 54 | // Compute the ratio between source width/height and destination width/height |
| 55 | const unsigned int src_width = src->dimension(idx_width); |
| 56 | const unsigned int src_height = src->dimension(idx_height); |
| 57 | const unsigned int dst_width = dst->dimension(idx_width); |
| 58 | const unsigned int dst_height = dst->dimension(idx_height); |
| 59 | |
| 60 | float scale_x = arm_compute::scale_utils::calculate_resize_ratio(src_width, dst_width, align_corners); |
| 61 | float scale_y = arm_compute::scale_utils::calculate_resize_ratio(src_height, dst_height, align_corners); |
| 62 | |
| 63 | return std::make_tuple(scale_x, scale_y); |
| 64 | } |
| 65 | |
| 66 | Status validate_arguments(const ITensorInfo *src, const ITensorInfo *dst, const ScaleKernelInfo &info) |
| 67 | { |
no test coverage detected