23.08
|
Interface for the kernel to perform tensor cropping. More...
#include <NECropKernel.h>
Public Types | |
using | InBoundsCropFunction = void(const ITensor *, const ITensor *, float *, Coordinates, int32_t, int32_t, int32_t, bool, bool) |
Function to use for in bounds crop for the particular tensor types passed to configure() More... | |
Public Member Functions | |
const char * | name () const override |
Name of the kernel. More... | |
NECropKernel () | |
Default constructor. More... | |
NECropKernel (const NECropKernel &)=delete | |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
NECropKernel & | operator= (const NECropKernel &)=delete |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
NECropKernel (NECropKernel &&)=default | |
Allow instances of this class to be moved. More... | |
NECropKernel & | operator= (NECropKernel &&)=default |
Allow instances of this class to be moved. More... | |
~NECropKernel ()=default | |
Default destructor. More... | |
void | configure (const ITensor *input, const ITensor *crop_boxes, const ITensor *box_ind, ITensor *output, uint32_t crop_box_ind=0, float extrapolation_value=0) |
Configure kernel. More... | |
void | configure_output_shape () |
Configure output tensor's shape as this can only be determined at runtime. More... | |
void | run (const Window &window, const ThreadInfo &info) override |
Execute the kernel on the passed window. More... | |
![]() | |
virtual | ~ICPPKernel ()=default |
Default destructor. More... | |
virtual void | run_nd (const Window &window, const ThreadInfo &info, const Window &thread_locator) |
legacy compatibility layer for implemantions which do not support thread_locator In these cases we simply narrow the interface down the legacy version More... | |
virtual void | run_op (ITensorPack &tensors, const Window &window, const ThreadInfo &info) |
Execute the kernel on the passed window. More... | |
virtual size_t | get_mws (const CPUInfo &platform, size_t thread_count) const |
Return minimum workload size of the relevant kernel. More... | |
![]() | |
IKernel () | |
Constructor. More... | |
virtual | ~IKernel ()=default |
Destructor. More... | |
virtual bool | is_parallelisable () const |
Indicates whether or not the kernel is parallelisable. More... | |
virtual BorderSize | border_size () const |
The size of the border for that kernel. More... | |
const Window & | window () const |
The maximum window the kernel can be executed on. More... | |
bool | is_window_configured () const |
Function to check if the embedded window of this kernel has been configured. More... | |
Static Public Member Functions | |
static Status | validate (const ITensorInfo *input, const ITensorInfo *crop_boxes, const ITensorInfo *box_ind, const ITensorInfo *output, uint32_t crop_box_ind=0, float extrapolation_value=0) |
Static function to check if given info will lead to a valid configuration of CLStridedSliceKernel. More... | |
Additional Inherited Members | |
![]() | |
static constexpr size_t | default_mws = 1 |
Interface for the kernel to perform tensor cropping.
Definition at line 37 of file NECropKernel.h.
using InBoundsCropFunction = void(const ITensor *, const ITensor *, float *, Coordinates, int32_t, int32_t, int32_t, bool, bool) |
Function to use for in bounds crop for the particular tensor types passed to configure()
Definition at line 94 of file NECropKernel.h.
NECropKernel | ( | ) |
Default constructor.
Definition at line 192 of file NECropKernel.cpp.
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
|
default |
Allow instances of this class to be moved.
|
default |
Default destructor.
void configure | ( | const ITensor * | input, |
const ITensor * | crop_boxes, | ||
const ITensor * | box_ind, | ||
ITensor * | output, | ||
uint32_t | crop_box_ind = 0 , |
||
float | extrapolation_value = 0 |
||
) |
Configure kernel.
[in] | input | Source tensor. Data type supported: U8/U16/S16/U32/S32/F16/F32. Data layouts supported: NHWC. |
[in] | crop_boxes | Tensor containing all possible boxes used to crop the image, each represented by 4 normalized values. Data type supported: F32 |
[in] | box_ind | One dimensional tensor mapping the crop_box_ind to the index of the 3D image in input . Data type supported: F32 |
[out] | output | Destination tensor. Data type supported: F32 |
[in] | crop_box_ind | Index of the crop box to be used from crop_boxes . Default is 0. |
[in] | extrapolation_value | Value to be used for values outside of the image. Default is 0. |
Definition at line 197 of file NECropKernel.cpp.
References ARM_COMPUTE_ERROR_ON_NULLPTR, ARM_COMPUTE_ERROR_THROW_ON, ITensor::info(), arm_compute::test::validation::input, and NECropKernel::validate().
void configure_output_shape | ( | ) |
Configure output tensor's shape as this can only be determined at runtime.
Definition at line 234 of file NECropKernel.cpp.
References arm_compute::calculate_max_window(), ITensorInfo::dimension(), ITensor::info(), ITensor::ptr_to_element(), ITensorInfo::set_tensor_shape(), and ITensorInfo::tensor_shape().
|
inlineoverridevirtual |
Name of the kernel.
Implements ICPPKernel.
Definition at line 40 of file NECropKernel.h.
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
|
default |
Allow instances of this class to be moved.
|
overridevirtual |
Execute the kernel on the passed window.
[in] | window | Region on which to execute the kernel. (Must be a region of the window returned by window()) |
[in] | info | Info about executing thread and CPU. |
Reimplemented from ICPPKernel.
Definition at line 292 of file NECropKernel.cpp.
References ARM_COMPUTE_ERROR_ON, ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW, ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL, ARM_COMPUTE_UNUSED, arm_compute::test::validation::data_type, ITensorInfo::dimension(), ITensorInfo::has_padding(), ITensor::info(), arm_compute::test::validation::info, ITensor::ptr_to_element(), and IKernel::window().
|
static |
Static function to check if given info will lead to a valid configuration of CLStridedSliceKernel.
[in] | input | Source tensor info. Data type supported: U8/U16/S16/U32/S32/F16/F32. Data layouts supported: NHWC. |
[in] | crop_boxes | Tensor info for tensor containing all possible boxes used to crop the image. Data type supported: F32 |
[in] | box_ind | Tensor info for the one dimensional tensor mapping the crop_box_ind to the index of the 3D image in input . Data type supported: F32 |
[in] | output | Destination tensor. Data type supported: F32 |
[in] | crop_box_ind | Index of the crop box to be used from crop_boxes . Default is 0. |
[in] | extrapolation_value | Value to be used for values outside of the image. Default is 0. |
Definition at line 210 of file NECropKernel.cpp.
References ARM_COMPUTE_RETURN_ERROR_ON, ARM_COMPUTE_RETURN_ERROR_ON_CPU_F16_UNSUPPORTED, ARM_COMPUTE_RETURN_ERROR_ON_DATA_LAYOUT_NOT_IN, ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN, ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_NOT_IN, ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_LAYOUT, ARM_COMPUTE_UNUSED, arm_compute::F16, arm_compute::F32, ITensorInfo::has_padding(), arm_compute::test::validation::input, arm_compute::NHWC, ITensorInfo::num_dimensions(), arm_compute::S16, arm_compute::S32, ITensorInfo::tensor_shape(), ITensorInfo::total_size(), arm_compute::U16, arm_compute::U32, and arm_compute::U8.
Referenced by NECropKernel::configure(), and NECropResize::validate().