ONE - On-device Neural Engine
|
#include <NEFullyConnectedHybridLayer.h>
Public Member Functions | |
NEFullyConnectedHybridLayer (std::shared_ptr< IMemoryManager > memory_manager=nullptr) | |
NEFullyConnectedHybridLayer (const NEFullyConnectedHybridLayer &)=delete | |
NEFullyConnectedHybridLayer (NEFullyConnectedHybridLayer &&)=default | |
NEFullyConnectedHybridLayer & | operator= (const NEFullyConnectedHybridLayer &)=delete |
NEFullyConnectedHybridLayer & | operator= (NEFullyConnectedHybridLayer &&)=default |
void | configure (const ITensor *input, const ITensor *weights, const ITensor *biases, ITensor *output, FullyConnectedLayerInfo fc_info=FullyConnectedLayerInfo()) |
void | run () override |
void | prepare () override |
Static Public Member Functions | |
static Status | validate (const ITensorInfo *input, const ITensorInfo *weights, const ITensorInfo *biases, const ITensorInfo *output, FullyConnectedLayerInfo fc_info=FullyConnectedLayerInfo()) |
Basic function to compute a Fully Connected layer on NEON. This function calls the following NEON 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 69 of file NEFullyConnectedHybridLayer.h.
NEFullyConnectedHybridLayer::NEFullyConnectedHybridLayer | ( | std::shared_ptr< IMemoryManager > | memory_manager = nullptr | ) |
Constructor
Definition at line 67 of file NEFullyConnectedHybridLayer.cpp.
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
|
default |
Default move constructor
void NEFullyConnectedHybridLayer::configure | ( | const ITensor * | input, |
const ITensor * | weights, | ||
const ITensor * | biases, | ||
ITensor * | output, | ||
FullyConnectedLayerInfo | fc_info = FullyConnectedLayerInfo() |
||
) |
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. 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: S8. |
[in] | biases | Bias tensor. Can be nullptr. Data type supported:Same as input . |
[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 85 of file NEFullyConnectedHybridLayer.cpp.
References arm_compute::NEMultiplyScaleFactorKernel::configure(), arm_compute::NEQuantizationSymmetricKernel::configure(), arm_compute::NEGEMMMatrixAccumulateBiasesKernel::configure(), and validate().
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
|
default |
Default move assignment operator
References validate().
|
override |
Definition at line 254 of file NEFullyConnectedHybridLayer.cpp.
Referenced by run().
|
override |
Definition at line 232 of file NEFullyConnectedHybridLayer.cpp.
References prepare().
Referenced by package.infer.session::inference().
|
static |
Static function to check if given info will lead to a valid configuration of NEFullyConnectedHybridLayer
[in] | input | Source tensor info. Data type supported: F16/F32. |
[in] | weights | Weights tensor info. 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: S8. |
[in] | biases | Bias tensor info. Can be nullptr. Data type supported:Same as input . |
[out] | output | Destination tensor info. 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 171 of file NEFullyConnectedHybridLayer.cpp.
References arm_compute::NEGEMMMatrixAccumulateBiasesKernel::validate(), arm_compute::NEQuantizationSymmetricKernel::validate(), and arm_compute::NEMultiplyScaleFactorKernel::validate().
Referenced by configure(), and operator=().