Compute Library
 21.02
CLChannelShuffleLayer Class Reference

Basic function to run CLChannelShuffleLayerKernel. More...

#include <CLChannelShuffleLayer.h>

Collaboration diagram for CLChannelShuffleLayer:
[legend]

Public Member Functions

void configure (const ICLTensor *input, ICLTensor *output, unsigned int num_groups)
 Initialize the function. More...
 
void configure (const CLCompileContext &compile_context, const ICLTensor *input, ICLTensor *output, unsigned int num_groups)
 Initialize the function. More...
 
- Public Member Functions inherited from ICLSimpleFunction
 ICLSimpleFunction (CLRuntimeContext *ctx=nullptr)
 Constructor. More...
 
 ICLSimpleFunction (const ICLSimpleFunction &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
 ICLSimpleFunction (ICLSimpleFunction &&)=default
 Default move constructor. More...
 
ICLSimpleFunctionoperator= (const ICLSimpleFunction &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
ICLSimpleFunctionoperator= (ICLSimpleFunction &&)=default
 Default move assignment operator. More...
 
 ~ICLSimpleFunction ()
 Default destructor. More...
 
void run () override final
 Run the kernels contained in the function. More...
 
- Public Member Functions inherited from IFunction
virtual ~IFunction ()=default
 Destructor. More...
 
virtual void prepare ()
 Prepare the function for executing. More...
 

Static Public Member Functions

static Status validate (const ITensorInfo *input, const ITensorInfo *output, unsigned int num_groups)
 Static function to check if given info will lead to a valid configuration of CLChannelShuffleLayerKernel. More...
 

Detailed Description

Basic function to run CLChannelShuffleLayerKernel.

Note
The function performs a channel shuffle operation on the input tensor. Given NCHW tensor with group G, it will first divide the channels into G groups, C = (G * C'), and perform a transpose of the channel, which gives C = (C' * G). for more details see: https://arxiv.org/pdf/1707.01083.pdf

Definition at line 42 of file CLChannelShuffleLayer.h.

Member Function Documentation

◆ configure() [1/2]

void configure ( const ICLTensor input,
ICLTensor output,
unsigned int  num_groups 
)

Initialize the function.

Parameters
[in]inputInput tensor. Data types supported: All.
[out]outputOutput tensor. Data type supported: Same as input
[in]num_groupsNumber of groups. Must be greater than 1 and the number of channels of the tensors must be a multiple of the number of groups.

Definition at line 31 of file CLChannelShuffleLayer.cpp.

References CLKernelLibrary::get().

32 {
33  configure(CLKernelLibrary::get().get_compile_context(), input, output, num_groups);
34 }
void configure(const ICLTensor *input, ICLTensor *output, unsigned int num_groups)
Initialize the function.
static CLKernelLibrary & get()
Access the KernelLibrary singleton.
const unsigned int num_groups
Definition: Im2Col.cpp:153

◆ configure() [2/2]

void configure ( const CLCompileContext compile_context,
const ICLTensor input,
ICLTensor output,
unsigned int  num_groups 
)

Initialize the function.

Parameters
[in]compile_contextThe compile context to be used.
[in]inputInput tensor. Data types supported: All.
[out]outputOutput tensor. Data type supported: Same as input
[in]num_groupsNumber of groups. Must be greater than 1 and the number of channels of the tensors must be a multiple of the number of groups.

Definition at line 36 of file CLChannelShuffleLayer.cpp.

37 {
38  auto k = std::make_unique<CLChannelShuffleLayerKernel>();
39  k->configure(compile_context, input, output, num_groups);
40  _kernel = std::move(k);
41 }
const unsigned int num_groups
Definition: Im2Col.cpp:153

◆ validate()

Status validate ( const ITensorInfo input,
const ITensorInfo output,
unsigned int  num_groups 
)
static

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

Parameters
[in]inputInput tensor info. Data types supported: All.
[in]outputOutput tensor info. Data type supported: Same as input
[in]num_groupsNumber of groups. Must be greater than 1 and the number of channels of the tensors must be a multiple of the number of groups.
Returns
a status

Definition at line 43 of file CLChannelShuffleLayer.cpp.

References CLChannelShuffleLayerKernel::validate().

Referenced by arm_compute::test::validation::DATA_TEST_CASE().

44 {
46 }
static Status validate(const ITensorInfo *input, const ITensorInfo *output, unsigned int num_groups)
Static function to check if given info will lead to a valid configuration of CLChannelShuffleLayerKer...
const unsigned int num_groups
Definition: Im2Col.cpp:153

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