Compute Library
 21.05
ClCrop Class Reference

Basic function to run kernels::ClCropKernel. More...

#include <ClCrop.h>

Collaboration diagram for ClCrop:
[legend]

Public Member Functions

 ClCrop ()=default
 Constructor. More...
 
void configure (const CLCompileContext &compile_context, const ITensorInfo *src, ITensorInfo *dst, Coordinates2D start, Coordinates2D end, uint32_t batch_index, float extrapolation_value=0, Window *dst_window=nullptr)
 Initialise the function's source and destination. More...
 
- Public Member Functions inherited from ICLOperator
 ICLOperator (IRuntimeContext *ctx=nullptr)
 Constructor. More...
 
 ICLOperator (const ICLOperator &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
 ICLOperator (ICLOperator &&)=default
 Default move constructor. More...
 
ICLOperatoroperator= (const ICLOperator &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
ICLOperatoroperator= (ICLOperator &&)=default
 Default move assignment operator. More...
 
void run (ITensorPack &tensors) override
 Run the kernels contained in the function. More...
 
void prepare (ITensorPack &constants) override
 Prepare the function for executing. 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, Coordinates2D start, Coordinates2D end, uint32_t batch_index, float extrapolation_value=0, Window *dst_window=nullptr)
 Static function to check if given info will lead to a valid configuration of kernels::ClCropKernel. More...
 

Detailed Description

Basic function to run kernels::ClCropKernel.

Definition at line 36 of file ClCrop.h.

Constructor & Destructor Documentation

◆ ClCrop()

ClCrop ( )
default

Constructor.

Member Function Documentation

◆ configure()

void configure ( const CLCompileContext compile_context,
const ITensorInfo src,
ITensorInfo dst,
Coordinates2D  start,
Coordinates2D  end,
uint32_t  batch_index,
float  extrapolation_value = 0,
Window dst_window = nullptr 
)

Initialise the function's source and destination.

Note
Supported tensor rank: up to 4
Parameters
[in]compile_contextThe compile context to be used.
[in]srcSource tensor info. Data type supported: All. Data layouts supported: NHWC.
[out]dstDestination tensor info. Data type supported: F32
[in]startCoordinates of where to start cropping the image.
[in]endCoordinates of where to end cropping the image.
[in]batch_indexFourth dimension index of the 3D image to crop in src.
[in]extrapolation_valueValue to be used for values outside of the image. Default is 0.
[in]dst_windowOutput window to be used in case cropped image is being copied into a tensor. Default is nullptr.

Definition at line 33 of file ClCrop.cpp.

35 {
36  auto k = std::make_unique<kernels::ClCropKernel>();
37  k->configure(compile_context, src, dst, start, end, batch_index, extrapolation_value, dst_window);
38  _kernel = std::move(k);
39 }
SimpleTensor< float > src
Definition: DFT.cpp:155
void end(TokenStream &in, bool &valid)
Definition: MLGOParser.cpp:290

References arm_compute::test::validation::dst, arm_compute::mlgo::parser::end(), and arm_compute::test::validation::src.

◆ validate()

Status validate ( const ITensorInfo src,
const ITensorInfo dst,
Coordinates2D  start,
Coordinates2D  end,
uint32_t  batch_index,
float  extrapolation_value = 0,
Window dst_window = nullptr 
)
static

Static function to check if given info will lead to a valid configuration of kernels::ClCropKernel.

Note
Supported tensor rank: up to 4
Parameters
[in]srcSource tensor info. Data type supported: All. Data layouts supported: NHWC.
[in]dstDestination tensor info. Data type supported: F32
[in]startCoordinates of where to start cropping the image.
[in]endCoordinates of where to end cropping the image.
[in]batch_indexFourth dimension index of the 3D image to crop in src.
[in]extrapolation_valueValue to be used for values outside of the image. Default is 0.
[in]dst_windowOutput window to be used in case cropped image is being copied into a tensor. Default is nullptr.

Definition at line 41 of file ClCrop.cpp.

42 {
43  return kernels::ClCropKernel::validate(src, dst, start, end, batch_index, extrapolation_value, dst_window);
44 }
SimpleTensor< float > src
Definition: DFT.cpp:155
void end(TokenStream &in, bool &valid)
Definition: MLGOParser.cpp:290
static Status validate(const ITensorInfo *src, const ITensorInfo *dst, Coordinates2D start, Coordinates2D end, uint32_t batch_index, float extrapolation_value=0, Window *dst_window=nullptr)
Static function to check if given info will lead to a valid configuration of CLStridedSliceKernel.

References arm_compute::test::validation::dst, arm_compute::mlgo::parser::end(), arm_compute::test::validation::src, and ClCropKernel::validate().

Referenced by CLCrop::validate().


The documentation for this class was generated from the following files: