23.11
|
Go to the documentation of this file.
32 bool border_undefined)
49 auto valid_start_out_x =
static_cast<int>(valid_start_in_x *
scale_x);
50 auto valid_start_out_y =
static_cast<int>(valid_start_in_y *
scale_y);
57 switch (interpolate_policy)
63 valid_start_out_x = std::ceil(valid_start_in_x *
scale_x - sampling_point);
64 valid_start_out_y = std::ceil(valid_start_in_y *
scale_y - sampling_point);
68 valid_end_out_x = std::ceil(valid_end_in_x *
scale_x - sampling_point);
69 valid_end_out_y = std::ceil(valid_end_in_y *
scale_y - sampling_point);
76 valid_start_out_x = std::ceil((valid_start_in_x + sampling_point) *
scale_x - sampling_point);
77 valid_start_out_y = std::ceil((valid_start_in_y + sampling_point) *
scale_y - sampling_point);
81 valid_end_out_x = std::floor((valid_end_in_x - 1.f + sampling_point) *
scale_x - sampling_point + 1.f);
82 valid_end_out_y = std::floor((valid_end_in_y - 1.f + sampling_point) *
scale_y - sampling_point + 1.f);
115 static const std::map<DataLayout, std::vector<DataLayoutDimension>> layout_map = {
@ NCHW
Num samples, channels, height, width.
void set(size_t dimension, T value, bool increase_dim_unit=true)
Accessor to set the value of one of the dimensions.
DataLayout
[DataLayout enum definition]
@ NCDHW
Num samples, channels, depth, height, width.
@ NHWC
Num samples, height, width, channels.
DataLayoutDimension
[DataLayout enum definition]
@ AREA
Output values are determined by averaging the source pixels whose areas fall under the area of the de...
SamplingPolicy
Available Sampling Policies.
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.
InterpolationPolicy
Interpolation method.
constexpr auto data_layout
const ValidRegion valid_region
const std::map< DataLayout, std::vector< DataLayoutDimension > > & get_layout_map()
Returns a static map used to find an index or dimension based on a data layout.
Container for valid region of a window.
@ BILINEAR
Output values are defined by bilinear interpolation between the pixels.
size_t get_data_layout_dimension_index(const DataLayout &data_layout, const DataLayoutDimension &data_layout_dimension)
Get the index of the given dimension.
TensorShape shape
Shape of the valid region.
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.
Copyright (c) 2017-2023 Arm Limited.
TensorInfo src_info(src_shape, 1, data_type)
@ NEAREST_NEIGHBOR
Output values are defined to match the source pixel whose center is nearest to the sample position.
@ CENTER
Samples are taken at pixel center.
Store the tensor's metadata.
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.
unsigned int num_dimensions() const
Returns the effective dimensionality of the tensor.
const TensorShape & tensor_shape() const override
Size for each dimension of the tensor.
@ NDHWC
Num samples, depth, height, width, channels.
Coordinates anchor
Anchor for the start of the valid region.