Compute Library
 22.11
CLStridedSlice Class Reference

Basic function to run CLStridedSliceKernel. More...

#include <CLStridedSlice.h>

Collaboration diagram for CLStridedSlice:
[legend]

Public Member Functions

void configure (const CLCompileContext &compile_context, const ITensorInfo *input, ITensorInfo *output, const Coordinates &starts, const Coordinates &ends, const BiStrides &strides, int32_t begin_mask=0, int32_t end_mask=0, int32_t shrink_axis_mask=0)
 Configure kernel. 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 *input, const ITensorInfo *output, const Coordinates &starts, const Coordinates &ends, const BiStrides &strides, int32_t begin_mask=0, int32_t end_mask=0, int32_t shrink_axis_mask=0)
 Static function to check if given info will lead to a valid configuration of CLStridedSlice. More...
 

Detailed Description

Basic function to run CLStridedSliceKernel.

Definition at line 128 of file CLStridedSlice.h.

Member Function Documentation

◆ configure()

void configure ( const CLCompileContext compile_context,
const ITensorInfo input,
ITensorInfo output,
const Coordinates starts,
const Coordinates ends,
const BiStrides strides,
int32_t  begin_mask = 0,
int32_t  end_mask = 0,
int32_t  shrink_axis_mask = 0 
)

Configure kernel.

Note
Supported tensor rank: up to 4
Parameters
[in]compile_contextThe compile context to be used.
[in]inputSource tensor info. Data type supported: All.
[out]outputDestination tensor info. Data type supported: Same as input
[in]startsThe starts of the dimensions of the input tensor to be sliced. The length must be of rank(input).
[in]endsThe ends of the dimensions of the input tensor to be sliced. The length must be of rank(input).
[in]stridesThe strides of the dimensions of the input tensor to be sliced. The length must be of rank(input).
[in]begin_mask(Optional) If the ith bit of begin_mask is set, starts[i] is ignored and the fullest possible range in that dimension is used instead.
[in]end_mask(Optional) If the ith bit of end_mask is set, ends[i] is ignored and the fullest possible range in that dimension is used instead.
[in]shrink_axis_mask(Optional) If the ith bit of shrink_axis_mask is set, it implies that the ith specification shrinks the dimensionality by 1. A slice of size 1 starting from starts[i] in the dimension must be preserved.

Definition at line 36 of file CLStridedSlice.cpp.

References ARM_COMPUTE_LOG_PARAMS, and arm_compute::test::validation::k.

39 {
40  ARM_COMPUTE_LOG_PARAMS(input, output, starts, ends, strides, begin_mask, end_mask, shrink_axis_mask);
41  auto k = std::make_unique<CLStridedSliceKernel>();
42  k->configure(compile_context, input, output, starts, ends, strides, begin_mask, end_mask, shrink_axis_mask);
43  _kernel = std::move(k);
44 }
#define ARM_COMPUTE_LOG_PARAMS(...)

◆ validate()

Status validate ( const ITensorInfo input,
const ITensorInfo output,
const Coordinates starts,
const Coordinates ends,
const BiStrides strides,
int32_t  begin_mask = 0,
int32_t  end_mask = 0,
int32_t  shrink_axis_mask = 0 
)
static

Static function to check if given info will lead to a valid configuration of CLStridedSlice.

Note
Supported tensor rank: up to 4
Parameters
[in]inputSource tensor info. Data type supported: All.
[in]outputDestination tensor info. Data type supported: Same as input
[in]startsThe starts of the dimensions of the input tensor to be sliced. The length must be of rank(input).
[in]endsThe ends of the dimensions of the input tensor to be sliced. The length must be of rank(input).
[in]stridesThe strides of the dimensions of the input tensor to be sliced. The length must be of rank(input).
[in]begin_mask(Optional) If the ith bit of begin_mask is set, starts[i] is ignored and the fullest possible range in that dimension is used instead.
[in]end_mask(Optional) If the ith bit of end_mask is set, ends[i] is ignored and the fullest possible range in that dimension is used instead.
[in]shrink_axis_mask(Optional) If the ith bit of shrink_axis_mask is set, it implies that the ith specification shrinks the dimensionality by 1. A slice of size 1 starting from starts[i] in the dimension must be preserved.

Definition at line 46 of file CLStridedSlice.cpp.

References arm_compute::test::validation::dst, arm_compute::test::validation::src, and CLStridedSliceKernel::validate().

Referenced by CLStridedSlice::validate().

49 {
50  return CLStridedSliceKernel::validate(input, output, starts, ends, strides, begin_mask, end_mask, shrink_axis_mask);
51 }
static Status validate(const ITensorInfo *input, const ITensorInfo *output, const Coordinates &starts, const Coordinates &ends, const BiStrides &strides, int32_t begin_mask, int32_t end_mask, int32_t shrink_axis_mask)
Static function to check if given info will lead to a valid configuration of CLStridedSliceKernel.

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