Compute Library
18.05
|
Basic function to compute a Fully Connected layer on OpenGL ES. More...
#include <GCFullyConnectedLayer.h>
Public Member Functions | |
GCFullyConnectedLayer (std::shared_ptr< IMemoryManager > memory_manager=nullptr) | |
Constructor. More... | |
void | configure (const IGCTensor *input, const IGCTensor *weights, const IGCTensor *biases, IGCTensor *output, bool transpose_weights=true, bool are_weights_reshaped=false, bool retain_internal_weights=false) |
Set the input and output tensors. More... | |
void | run () override |
Run the kernels contained in the function. More... | |
![]() | |
virtual | ~IFunction ()=default |
Destructor. More... | |
virtual void | prepare () |
Prepare the function for executing. More... | |
Basic function to compute a Fully Connected layer on OpenGL ES.
This function calls the following OpenGL ES kernels:
are_weights_reshaped
is set to false and transpose_weights is set to true ) (called once)biases
is not equal to nullptr)Definition at line 63 of file GCFullyConnectedLayer.h.
GCFullyConnectedLayer | ( | std::shared_ptr< IMemoryManager > | memory_manager = nullptr | ) |
Constructor.
void configure | ( | const IGCTensor * | input, |
const IGCTensor * | weights, | ||
const IGCTensor * | biases, | ||
IGCTensor * | output, | ||
bool | transpose_weights = true , |
||
bool | are_weights_reshaped = false , |
||
bool | retain_internal_weights = false |
||
) |
Set the input and output tensors.
[in] | input | Source tensor. Data type supported: F16/F32. |
[in] | weights | Weights tensor. The weights must be 2 dimensional. Data type supported: Same as input |
[in] | biases | Bias tensor. It can be nullptr. Data type supported:Same as input . |
[out] | output | Destination tensor. Data type supported: Same as input . |
[in] | transpose_weights | (Optional) Transpose weights if true. Defaults to true. |
[in] | are_weights_reshaped | (Optional) Reshape the weights tensor if false. Defaults to false. |
[in] | retain_internal_weights | (Optional) Retain internal reshaped weights. Defaults to false. Used for reconfiguration purposes. |
|
overridevirtual |
Run the kernels contained in the function.
For NEON kernels:
For OpenCL kernels:
Implements IFunction.