36 const ITensor *
src{
nullptr };
37 ITensor *
dst{
nullptr };
41 std::unique_ptr<cpu::CpuScale> op{
nullptr };
45 : _impl(std::make_unique<Impl>())
54 _impl->op = std::make_unique<cpu::CpuScale>();
78 _impl->dx.allocator()->init(tensor_info_dxdy);
79 _impl->dy.allocator()->init(tensor_info_dxdy);
80 _impl->offsets.allocator()->init(tensor_info_offsets);
86 _impl->offsets.allocator()->allocate();
92 _impl->dx.allocator()->allocate();
93 _impl->dy.allocator()->allocate();
94 _impl->offsets.allocator()->allocate();
119 _impl->op->run(pack);
InterpolationPolicy
Interpolation method.
InterpolationPolicy interpolation_policy
Interpolation type to use.
virtual size_t dimension(size_t index) const =0
Return the size of the requested dimension.
#define ARM_COMPUTE_ERROR(msg)
Print the given message then throw an std::runtime_error.
1 channel, 1 F32 per channel
Output values are defined by bilinear interpolation between the pixels.
const DataLayout data_layout
bool align_corners
Align corners of input and output.
Store the tensor's metadata.
Output values are defined to match the source pixel whose center is nearest to the sample position.
Interface for CPU tensor.
SimpleTensor< float > src
Copyright (c) 2017-2021 Arm Limited.
bool is_align_corners_allowed_sampling_policy(SamplingPolicy sampling_policy)
Returns if aligned corners are allowed for the given sampling policy.
1 channel, 1 S32 per channel
static Status validate(const ITensorInfo *src, const ITensorInfo *dst, const ScaleKernelInfo &info)
Static function to check if given info will lead to a valid configuration of NEScale.
static Status validate(const ITensorInfo *input, const ITensorInfo *output, const ScaleKernelInfo &info)
Static function to check if given info will lead to a valid configuration of NEScale.
SamplingPolicy sampling_policy
Sampling policy used by the interpolation.
virtual ITensorInfo * info() const =0
Interface to be implemented by the child class to return the tensor's metadata.
void configure(ITensor *input, ITensor *output, const ScaleKernelInfo &info)
Initialize the function's source, destination, interpolation type and border_mode.
Output values are determined by averaging the source pixels whose areas fall under the area of the de...
ScaleKernelInfo info(interpolation_policy, default_border_mode, PixelValue(), sampling_policy, false)
void run() override
Run the kernels contained in the function.
Store the tensor's metadata.
float calculate_resize_ratio(size_t input_size, size_t output_size, bool align_corners=false)
Returns resize ratio between input and output with consideration of aligned corners.
size_t get_data_layout_dimension_index(const DataLayout data_layout, const DataLayoutDimension data_layout_dimension)
Get the index of the given dimension.
DataLayout data_layout
Data layout to use.
DataLayout
[DataLayout enum definition]
void add_tensor(int id, ITensor *tensor)
Add tensor to the pack.