46 auto valid_start_out_x = static_cast<int>(valid_start_in_x *
scale_x);
47 auto valid_start_out_y = static_cast<int>(valid_start_in_y *
scale_y);
54 switch(interpolate_policy)
60 valid_start_out_x = std::ceil(valid_start_in_x *
scale_x - sampling_point);
61 valid_start_out_y = std::ceil(valid_start_in_y *
scale_y - sampling_point);
65 valid_end_out_x = std::ceil(valid_end_in_x *
scale_x - sampling_point);
66 valid_end_out_y = std::ceil(valid_end_in_y *
scale_y - sampling_point);
73 valid_start_out_x = std::ceil((valid_start_in_x + sampling_point) *
scale_x - sampling_point);
74 valid_start_out_y = std::ceil((valid_start_in_y + sampling_point) *
scale_y - sampling_point);
78 valid_end_out_x = std::floor((valid_end_in_x - 1.f + sampling_point) *
scale_x - sampling_point + 1.f);
79 valid_end_out_y = std::floor((valid_end_in_y - 1.f + sampling_point) *
scale_y - sampling_point + 1.f);
void set(size_t dimension, T value, bool increase_dim_unit=true)
Accessor to set the value of one of the dimensions.
InterpolationPolicy
Interpolation method.
TensorShape shape
Shape of the valid region.
ValidRegion valid_region() const override
Valid region of the tensor.
DataLayout data_layout() const override
Get the data layout of the tensor.
#define ARM_COMPUTE_ERROR(msg)
Print the given message then throw an std::runtime_error.
Output values are defined by bilinear interpolation between the pixels.
const DataLayout data_layout
Store the tensor's metadata.
Output values are defined to match the source pixel whose center is nearest to the sample position.
const ValidRegion valid_region
Copyright (c) 2017-2021 Arm Limited.
Samples are taken at pixel center.
Output values are determined by averaging the source pixels whose areas fall under the area of the de...
TensorInfo src_info(src_shape, 1, data_type)
ValidRegion calculate_valid_region_scale(const ITensorInfo &src_info, const TensorShape &dst_shape, InterpolationPolicy interpolate_policy, SamplingPolicy sampling_policy, bool border_undefined)
Helper function to calculate the Valid Region for Scale.
unsigned int num_dimensions() const
Returns the effective dimensionality of the tensor.
Container for valid region of a window.
size_t get_data_layout_dimension_index(const DataLayout data_layout, const DataLayoutDimension data_layout_dimension)
Get the index of the given dimension.
const TensorShape & tensor_shape() const override
Size for each dimension of the tensor.
DataLayout
[DataLayout enum definition]
TensorShape & set(size_t dimension, size_t value, bool apply_dim_correction=true, bool increase_dim_unit=true)
Accessor to set the value of one of the dimensions.
Coordinates anchor
Anchor for the start of the valid region.
SamplingPolicy
Available Sampling Policies.