Compute Library
 21.02
NEConvolutionLayerReshapeWeightsTransform Class Reference

Basic function to manage the reshape weights generated from NEConvolutionLayerReshapeWeights. More...

#include <NEGEMMConvolutionLayer.h>

Collaboration diagram for NEConvolutionLayerReshapeWeightsTransform:
[legend]

Public Member Functions

 NEConvolutionLayerReshapeWeightsTransform ()=default
 Constructor. More...
 
 NEConvolutionLayerReshapeWeightsTransform (const NEConvolutionLayerReshapeWeightsTransform &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
NEConvolutionLayerReshapeWeightsTransformoperator= (const NEConvolutionLayerReshapeWeightsTransform &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
 NEConvolutionLayerReshapeWeightsTransform (NEConvolutionLayerReshapeWeightsTransform &&)=delete
 Prevent instances of this class from being moved (As this class contains non movable objects) More...
 
NEConvolutionLayerReshapeWeightsTransformoperator= (NEConvolutionLayerReshapeWeightsTransform &&)=delete
 Prevent instances of this class from being moved (As this class contains non movable objects) More...
 
 ~NEConvolutionLayerReshapeWeightsTransform ()=default
 Default destructor. More...
 
void configure (const ITensor *input, const ITensor *biases)
 
void run () override
 Run the transformation function. More...
 
ITensorget_weights () override
 Get a pointer to the transformed weights. More...
 
void release () override
 Release transformed weights memory. More...
 
uint32_t uid () override
 Function that returns a unique id of the reshape function. More...
 
bool is_reshape_run ()
 
- 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 the reshape weights generated from NEConvolutionLayerReshapeWeights.

Definition at line 98 of file NEGEMMConvolutionLayer.h.

Constructor & Destructor Documentation

◆ NEConvolutionLayerReshapeWeightsTransform() [1/3]

◆ NEConvolutionLayerReshapeWeightsTransform() [2/3]

Prevent instances of this class from being copied (As this class contains pointers)

◆ NEConvolutionLayerReshapeWeightsTransform() [3/3]

Prevent instances of this class from being moved (As this class contains non movable objects)

◆ ~NEConvolutionLayerReshapeWeightsTransform()

Default destructor.

Member Function Documentation

◆ configure()

void configure ( const ITensor input,
const ITensor biases 
)
inline

Definition at line 113 of file NEGEMMConvolutionLayer.h.

Referenced by NEGEMMConvolutionLayer::configure().

114  {
115  _bias_bit = (biases != nullptr) ? 1 : 0;
116  _func.configure(input, biases, &_output);
117  }
void configure(const ITensor *weights, const ITensor *biases, ITensor *output)
Set the input and output tensors.

◆ get_weights()

ITensor* get_weights ( )
inlineoverridevirtual

Get a pointer to the transformed weights.

Returns
The pointer to the transformed ITensor weights

Implements ITransformWeights.

Definition at line 126 of file NEGEMMConvolutionLayer.h.

127  {
128  return &_output;
129  }

◆ is_reshape_run()

bool is_reshape_run ( )
inline

Definition at line 141 of file NEGEMMConvolutionLayer.h.

142  {
143  return _reshape_run;
144  }

◆ operator=() [1/2]

Prevent instances of this class from being copied (As this class contains pointers)

◆ operator=() [2/2]

Prevent instances of this class from being moved (As this class contains non movable objects)

◆ release()

void release ( )
inlineoverridevirtual

Release transformed weights memory.

Implements ITransformWeights.

Definition at line 131 of file NEGEMMConvolutionLayer.h.

132  {
133  _output.allocator()->free();
134  }
TensorAllocator * allocator()
Return a pointer to the tensor&#39;s allocator.
Definition: Tensor.cpp:48
void free() override
Free allocated CPU memory.

◆ run()

void run ( )
inlineoverridevirtual

Run the transformation function.

Implements ITransformWeights.

Definition at line 119 of file NEGEMMConvolutionLayer.h.

120  {
121  _output.allocator()->allocate();
122  _func.run();
123  _reshape_run = true;
124  }
TensorAllocator * allocator()
Return a pointer to the tensor&#39;s allocator.
Definition: Tensor.cpp:48
void allocate() override
Allocate size specified by TensorInfo of CPU memory.
void run() override
Run the kernels contained in the function.

◆ 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 136 of file NEGEMMConvolutionLayer.h.

137  {
138  return ((0x8) | (_bias_bit << 7));
139  }

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