21.08
|
Basic function to compute a Fully Connected layer. More...
#include <NEFullyConnectedLayer.h>
Public Member Functions | |
NEFullyConnectedLayer (std::shared_ptr< IMemoryManager > memory_manager=nullptr, IWeightsManager *weights_manager=nullptr) | |
Constructor. More... | |
NEFullyConnectedLayer (const NEFullyConnectedLayer &)=delete | |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
NEFullyConnectedLayer (NEFullyConnectedLayer &&)=delete | |
Prevent instances of this class from being moved (As this class contains pointers) More... | |
NEFullyConnectedLayer & | operator= (const NEFullyConnectedLayer &)=delete |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
NEFullyConnectedLayer & | operator= (NEFullyConnectedLayer &&)=delete |
Prevent instances of this class from being moved (As this class contains pointers) More... | |
~NEFullyConnectedLayer () | |
Default destructor. More... | |
void | configure (const ITensor *input, const ITensor *weights, const ITensor *biases, ITensor *output, FullyConnectedLayerInfo fc_info=FullyConnectedLayerInfo()) |
Set the input and output tensors. More... | |
void | run () override |
Run the kernels contained in the function. More... | |
void | prepare () override |
Prepare the function for executing. More... | |
Public Member Functions inherited from IFunction | |
virtual | ~IFunction ()=default |
Destructor. More... | |
Static Public Member Functions | |
static Status | validate (const ITensorInfo *input, const ITensorInfo *weights, const ITensorInfo *biases, const ITensorInfo *output, FullyConnectedLayerInfo fc_info=FullyConnectedLayerInfo()) |
Static function to check if given info will lead to a valid configuration of NEFullyConnectedLayer. More... | |
Basic function to compute a Fully Connected layer.
This function calls the following 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 86 of file NEFullyConnectedLayer.h.
NEFullyConnectedLayer | ( | std::shared_ptr< IMemoryManager > | memory_manager = nullptr , |
IWeightsManager * | weights_manager = nullptr |
||
) |
Constructor.
Definition at line 55 of file NEFullyConnectedLayer.cpp.
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
|
delete |
Prevent instances of this class from being moved (As this class contains pointers)
|
default |
Default destructor.
void configure | ( | const ITensor * | input, |
const ITensor * | weights, | ||
const ITensor * | biases, | ||
ITensor * | output, | ||
FullyConnectedLayerInfo | fc_info = FullyConnectedLayerInfo() |
||
) |
Set the input and output tensors.
Valid data layouts:
Valid data type configurations:
src0 | src1 | src2 | dst |
---|---|---|---|
F16 | F16 | F16 | F16 |
F32 | F32 | F32 | F32 |
QASYMM8 | QASYMM8 | S32 | QASYMM8 |
QASYMM8_SIGNED | QASYMM8_SIGNED | S32 | QASYMM8_SIGNED |
[in] | input | Source tensor. Data type supported: QASYMM8/QASYMM8_SIGNED/F16/F32. |
[in] | weights | Weights tensor. The weights must be 2 dimensional. If this function is called after a Convolution Layer, the (transposed) weights will have as many rows as the product of the first 3 input's dimensions. If it is called after another FullyConnected Layer, the (transposed) weights will have as many rows as the input's first dimension. Data type supported: Same as input . |
[in] | biases | Bias tensor. Can be nullptr. Data type supported: Same as weights , S32 if weights is QASYMM8/QASYMM8_SIGNED. |
[out] | output | Destination tensor. Its shape should be equal to the output of a matrix multiplication between:
|
[in] | fc_info | (Optional) Fully connected layer additional info |
Definition at line 62 of file NEFullyConnectedLayer.cpp.
References arm_compute::ACL_DST, arm_compute::ACL_SRC_0, arm_compute::ACL_SRC_1, arm_compute::ACL_SRC_2, ARM_COMPUTE_ERROR_ON_NULLPTR, ARM_COMPUTE_ERROR_THROW_ON, ITensor::info(), and NEFullyConnectedLayer::validate().
Referenced by NERNNLayer::configure(), and NELSTMLayer::configure().
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
|
delete |
Prevent instances of this class from being moved (As this class contains pointers)
|
overridevirtual |
Prepare the function for executing.
Any one off pre-processing step required by the function is handled here
Reimplemented from IFunction.
Definition at line 103 of file NEFullyConnectedLayer.cpp.
References ITensor::is_used().
Referenced by NERNNLayer::prepare(), and NEFullyConnectedLayer::run().
|
overridevirtual |
Run the kernels contained in the function.
For CPU kernels:
For OpenCL kernels:
Implements IFunction.
Definition at line 95 of file NEFullyConnectedLayer.cpp.
References NEFullyConnectedLayer::prepare().
Referenced by NERNNLayer::run(), and NELSTMLayer::run().
|
static |
Static function to check if given info will lead to a valid configuration of NEFullyConnectedLayer.
Similar to NEFullyConnectedLayer
Definition at line 89 of file NEFullyConnectedLayer.cpp.
References CpuFullyConnected::validate().
Referenced by NEFullyConnectedLayer::configure(), arm_compute::test::validation::DATA_TEST_CASE(), NERNNLayer::validate(), and NELSTMLayer::validate().