Compute Library
 21.08
CLConvertFullyConnectedWeightsManaged Class Reference

Basic function to manage CLConvertFullyConnectedWeights. More...

#include <CLConvertFullyConnectedWeights.h>

Collaboration diagram for CLConvertFullyConnectedWeightsManaged:
[legend]

Public Member Functions

void run () override
 Run the transformation function. More...
 
void release () override
 Release transformed weights memory. More...
 
ICLTensorget_weights () override
 Get a pointer to the transformed weights. More...
 
uint32_t uid () override
 Function that returns a unique id of the reshape function. More...
 
void configure (const ICLTensor *input, const TensorShape &original_input_shape, DataLayout data_layout)
 Configures the CLConvertFullyConnectedWeights function. More...
 
void configure (const CLCompileContext &compile_context, const ICLTensor *input, const TensorShape &original_input_shape, DataLayout data_layout)
 Configures the CLConvertFullyConnectedWeights function. More...
 
- Public Member Functions inherited from ITransformWeights
 ITransformWeights ()=default
 Default Constructor. More...
 
virtual ~ITransformWeights ()=default
 Default Destructor. More...
 
 ITransformWeights (const ITransformWeights &)=delete
 Prevent instances of this class to be copy constructed. More...
 
ITransformWeightsoperator= (const ITransformWeights &)=delete
 Prevent instances of this class to be copied. More...
 
 ITransformWeights (ITransformWeights &&other)
 Allow instances of this class to be move constructed. More...
 
ITransformWeightsoperator= (ITransformWeights &&other)
 Allow instances of this class to be moved. More...
 
void increase_refcount ()
 Increase the object's refcount. More...
 
int32_t decrease_refcount ()
 Decrease the object's refcount and return the updated value. More...
 
bool is_reshape_run ()
 Function that returns a flag on whether the weights are reshaped or not. More...
 

Detailed Description

Basic function to manage CLConvertFullyConnectedWeights.

Definition at line 106 of file CLConvertFullyConnectedWeights.h.

Member Function Documentation

◆ configure() [1/2]

void configure ( const ICLTensor input,
const TensorShape original_input_shape,
DataLayout  data_layout 
)
inline

Configures the CLConvertFullyConnectedWeights function.

Parameters
[in]inputSource weights tensor info to convert. Data type supported: All.
[in]original_input_shapeShape of the original input tensor (the one entering fully connected layer).
[in]data_layoutThe data layout the weights have been trained in.

Definition at line 140 of file CLConvertFullyConnectedWeights.h.

References CLConvertFullyConnectedWeights::configure(), and CLKernelLibrary::get().

141  {
142  configure(CLKernelLibrary::get().get_compile_context(), input, original_input_shape, data_layout);
143  }
const DataLayout data_layout
Definition: Im2Col.cpp:151
static CLKernelLibrary & get()
Access the KernelLibrary singleton.
void configure(const ICLTensor *input, const TensorShape &original_input_shape, DataLayout data_layout)
Configures the CLConvertFullyConnectedWeights function.

◆ configure() [2/2]

void configure ( const CLCompileContext compile_context,
const ICLTensor input,
const TensorShape original_input_shape,
DataLayout  data_layout 
)
inline

Configures the CLConvertFullyConnectedWeights function.

Parameters
[in]compile_contextThe compile context to be used.
[in]inputSource weights tensor info to convert. Data type supported: All.
[in]original_input_shapeShape of the original input tensor (the one entering fully connected layer).
[in]data_layoutThe data layout the weights have been trained in.

Definition at line 151 of file CLConvertFullyConnectedWeights.h.

152  {
153  _func.configure(compile_context, input, &_output, original_input_shape, data_layout);
154  }
const DataLayout data_layout
Definition: Im2Col.cpp:151
void configure(const ICLTensor *input, ICLTensor *output, const TensorShape &original_input_shape, DataLayout data_layout)
Initialize the function.

◆ get_weights()

ICLTensor* get_weights ( )
inlineoverridevirtual

Get a pointer to the transformed weights.

Returns
The pointer to the transformed ITensor weights

Implements ITransformWeights.

Definition at line 124 of file CLConvertFullyConnectedWeights.h.

125  {
126  return &_output;
127  }

◆ release()

void release ( )
inlineoverridevirtual

Release transformed weights memory.

Implements ITransformWeights.

Definition at line 118 of file CLConvertFullyConnectedWeights.h.

119  {
120  _output.allocator()->free();
121  }
CLTensorAllocator * allocator()
Return a pointer to the tensor&#39;s allocator.
Definition: CLTensor.cpp:61
void free() override
Free allocated OpenCL memory.

◆ run()

void run ( )
inlineoverridevirtual

Run the transformation function.

Implements ITransformWeights.

Definition at line 110 of file CLConvertFullyConnectedWeights.h.

111  {
112  _output.allocator()->allocate();
113  _func.run();
114  _reshape_run = true;
115  }
CLTensorAllocator * allocator()
Return a pointer to the tensor&#39;s allocator.
Definition: CLTensor.cpp:61
void run() override
Run the kernels contained in the function.
void allocate() override
Allocate size specified by TensorInfo of OpenCL memory.

◆ uid()

uint32_t uid ( )
inlineoverridevirtual

Function that returns a unique id of the reshape function.

Returns
The computed unique id

Implements ITransformWeights.

Definition at line 130 of file CLConvertFullyConnectedWeights.h.

131  {
132  return _uid;
133  }

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