24.02.1
|
Basic function to compute Scale. More...
#include <CpuScale.h>
Public Member Functions | |
void | configure (ITensorInfo *src, ITensorInfo *dst, const ScaleKernelInfo &info) |
Initialize the function's source, destination, interpolation type and border_mode. More... | |
void | prepare (ITensorPack &tensors) override |
Prepare the function for executing. More... | |
void | run (ITensorPack &tensors) override |
Run the kernels contained in the function. More... | |
Public Member Functions inherited from INEOperator | |
INEOperator (IRuntimeContext *ctx=nullptr) | |
Constructor. More... | |
INEOperator (const INEOperator &)=delete | |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
INEOperator (INEOperator &&)=default | |
Default move constructor. More... | |
INEOperator & | operator= (const INEOperator &)=delete |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
INEOperator & | operator= (INEOperator &&)=default |
Default move assignment operator. More... | |
~INEOperator () | |
Default destructor. More... | |
MemoryRequirements | workspace () const override |
Return the memory requirements required by the workspace. More... | |
Public Member Functions inherited from IOperator | |
virtual | ~IOperator ()=default |
Destructor. More... | |
Static Public Member Functions | |
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. More... | |
Basic function to compute Scale.
Definition at line 41 of file CpuScale.h.
void configure | ( | ITensorInfo * | src, |
ITensorInfo * | dst, | ||
const ScaleKernelInfo & | info | ||
) |
Initialize the function's source, destination, interpolation type and border_mode.
[in,out] | src | Source tensor info. Data type supported: QASYMM8/QASYMM8_SIGNED/U8/S16/F16/F32. (Written to only for border_mode != UNDEFINED) |
[out] | dst | Destination tensor info. Data type supported: Same as src . All but the lowest two dimensions must be the same size as in the input tensor, i.e. scaling is only performed within the XY-plane. |
[in] | info | ScaleKernelInfo to be used for configuration |
border_mode
Replicate, and policy
Bilinear Definition at line 97 of file CpuScale.cpp.
References ScaleKernelInfo::align_corners, arm_compute::AREA, ARM_COMPUTE_ERROR, ARM_COMPUTE_ERROR_ON_NULLPTR, ARM_COMPUTE_ERROR_THROW_ON, ARM_COMPUTE_LOG_PARAMS, arm_compute::BILINEAR, arm_compute::scale_utils::calculate_resize_ratio(), ScaleKernelInfo::data_layout, arm_compute::test::validation::dst, arm_compute::F32, arm_compute::get_data_layout_dimension_index(), arm_compute::HEIGHT, arm_compute::test::validation::idx_height, arm_compute::test::validation::idx_width, arm_compute::test::validation::info, ScaleKernelInfo::interpolation_policy, arm_compute::scale_utils::is_align_corners_allowed_sampling_policy(), arm_compute::NEAREST_NEIGHBOR, arm_compute::S32, ScaleKernelInfo::sampling_policy, arm_compute::test::validation::shape, arm_compute::test::validation::src, arm_compute::UNKNOWN, CpuScale::validate(), and arm_compute::WIDTH.
|
overridevirtual |
Prepare the function for executing.
Any one off pre-processing step required by the function is handled here
[in] | constants | Vector that contains the constants tensors. |
Reimplemented from INEOperator.
Definition at line 213 of file CpuScale.cpp.
References arm_compute::ACL_DST, arm_compute::ACL_INT_0, arm_compute::ACL_INT_1, arm_compute::ACL_INT_2, arm_compute::ACL_SRC, ScaleKernelInfo::align_corners, arm_compute::AREA, ARM_COMPUTE_ERROR, arm_compute::BILINEAR, ScaleKernelInfo::border_mode, arm_compute::scale_utils::calculate_resize_ratio(), arm_compute::test::validation::dst, ITensorPack::get_const_tensor(), arm_compute::get_data_layout_dimension_index(), ITensorPack::get_tensor(), arm_compute::HEIGHT, arm_compute::test::validation::idx_height, arm_compute::test::validation::idx_width, ScaleKernelInfo::interpolation_policy, arm_compute::scale_utils::is_align_corners_allowed_sampling_policy(), arm_compute::scale_utils::is_precomputation_required(), arm_compute::NEAREST_NEIGHBOR, ScaleKernelInfo::sampling_policy, arm_compute::test::validation::sampling_policy, arm_compute::test::validation::src, and arm_compute::WIDTH.
Referenced by CpuScale::run().
|
overridevirtual |
Run the kernels contained in the function.
[in] | tensors | Vector that contains the tensors to operate on. |
Reimplemented from INEOperator.
Definition at line 282 of file CpuScale.cpp.
References ARM_COMPUTE_ERROR_ON_MSG, Window::DimY, ITensorPack::empty(), Scheduler::get(), CpuScale::prepare(), and IScheduler::schedule_op().
|
static |
Static function to check if given info will lead to a valid configuration.
Similar to CpuScale::configure()
Definition at line 160 of file CpuScale.cpp.
References ScaleKernelInfo::align_corners, arm_compute::AREA, ARM_COMPUTE_RETURN_ERROR_ON, ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR, ARM_COMPUTE_RETURN_ON_ERROR, arm_compute::BILINEAR, arm_compute::scale_utils::calculate_resize_ratio(), arm_compute::CENTER, arm_compute::cpu::data_layout, ScaleKernelInfo::data_layout, arm_compute::test::validation::dst, arm_compute::F32, arm_compute::get_data_layout_dimension_index(), arm_compute::HEIGHT, arm_compute::test::validation::idx_height, arm_compute::test::validation::idx_width, arm_compute::test::validation::info, ScaleKernelInfo::interpolation_policy, arm_compute::scale_utils::is_align_corners_allowed_sampling_policy(), arm_compute::NEAREST_NEIGHBOR, arm_compute::S32, ScaleKernelInfo::sampling_policy, arm_compute::test::validation::shape, arm_compute::test::validation::src, arm_compute::TOP_LEFT, arm_compute::UNKNOWN, CpuScaleKernel::validate(), and arm_compute::WIDTH.
Referenced by CpuScale::configure(), and NEScale::validate().