aboutsummaryrefslogtreecommitdiff
path: root/arm_compute/runtime/NEON/functions/NEFullyConnectedLayer.h
diff options
context:
space:
mode:
authorTeresa Charlin <teresa.charlinreyes@arm.com>2021-04-07 20:39:49 +0100
committerTeresaARM <teresa.charlinreyes@arm.com>2021-04-08 09:28:00 +0000
commit28fcc35fbc0b22e85d234a882a9c1f9c4faa3900 (patch)
tree2533b66ef531219f0e3cee6cbdab9b72aa6f7e29 /arm_compute/runtime/NEON/functions/NEFullyConnectedLayer.h
parent3b5981ce898569aafa98abdf220c73f1a80685b9 (diff)
downloadComputeLibrary-28fcc35fbc0b22e85d234a882a9c1f9c4faa3900.tar.gz
Substitute NEFullyConnectedLayerReshapeWeights by NETranspose
Resolves partially: COMPMID-4359 (2/2) Signed-off-by: Teresa Charlin <teresa.charlinreyes@arm.com> Change-Id: Id65ef04268575cc9d74be6114e82e116b8ed106d Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/5378 Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Georgios Pinitas <georgios.pinitas@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'arm_compute/runtime/NEON/functions/NEFullyConnectedLayer.h')
-rw-r--r--arm_compute/runtime/NEON/functions/NEFullyConnectedLayer.h54
1 files changed, 7 insertions, 47 deletions
diff --git a/arm_compute/runtime/NEON/functions/NEFullyConnectedLayer.h b/arm_compute/runtime/NEON/functions/NEFullyConnectedLayer.h
index 58b11744a8..bc45e58b4b 100644
--- a/arm_compute/runtime/NEON/functions/NEFullyConnectedLayer.h
+++ b/arm_compute/runtime/NEON/functions/NEFullyConnectedLayer.h
@@ -31,55 +31,15 @@
#include "arm_compute/runtime/NEON/functions/NEFlattenLayer.h"
#include "arm_compute/runtime/NEON/functions/NEGEMM.h"
#include "arm_compute/runtime/NEON/functions/NEGEMMLowpMatrixMultiplyCore.h"
+#include "arm_compute/runtime/NEON/functions/NETranspose.h"
#include "arm_compute/runtime/Tensor.h"
namespace arm_compute
{
-/** Basic function to reshape the weights of Fully Connected layer. This function calls the following kernels:
- *
- * @note The fully connected layer accepts "weights" tensors only with 2 dimensions.
- */
-class NEFullyConnectedLayerReshapeWeights : public IFunction
-{
-public:
- /** Constructor */
- NEFullyConnectedLayerReshapeWeights();
- /** Prevent instances of this class from being copied (As this class contains pointers) */
- NEFullyConnectedLayerReshapeWeights(const NEFullyConnectedLayerReshapeWeights &) = delete;
- /** Prevent instances of this class from being copied (As this class contains pointers) */
- NEFullyConnectedLayerReshapeWeights &operator=(const NEFullyConnectedLayerReshapeWeights &) = delete;
- /** Prevent instances of this class from being moved (As this class contains non movable objects) */
- NEFullyConnectedLayerReshapeWeights(NEFullyConnectedLayerReshapeWeights &&) = delete;
- /** Prevent instances of this class from being moved (As this class contains non movable objects) */
- NEFullyConnectedLayerReshapeWeights &operator=(NEFullyConnectedLayerReshapeWeights &&) = delete;
- /** Default destructor */
- ~NEFullyConnectedLayerReshapeWeights();
- /** Set the input and output tensors.
- *
- * @param[in] input Weights tensor. The weights must be 2 dimensional. Data types supported: QASYMM8/QASYMM8_SIGNED/F16/F32.
- * @param[out] output Destination tensor. Data type supported: Same as @p input.
- */
- void configure(const ITensor *input, ITensor *output);
- /** Static function to check if given info will lead to a valid configuration of @ref NEFullyConnectedLayerReshapeWeights
- *
- * @param[in] input Weights tensor info. The weights must be 2 dimensional. Data types supported: QASYMM8/QASYMM8_SIGNED/F16/F32.
- * @param[in] output Destination tensor info. Data type supported: Same as @p input.
- *
- * @return a status
- */
- static Status validate(const ITensorInfo *input, const ITensorInfo *output);
-
- // Inherited methods overridden
- void run() override;
-
-private:
- struct Impl;
- std::unique_ptr<Impl> _impl;
-};
namespace weights_transformations
{
-/** Basic function to manage the reshape weights generated from @ref NEFullyConnectedLayerReshapeWeights */
+/** Basic function to manage the reshape weights generated from @ref NETranspose */
class NEFullyConnectedLayerReshapeWeightsManaged : public ITransformWeights
{
public:
@@ -111,15 +71,15 @@ public:
}
private:
- static constexpr uint32_t _uid = 0x0;
- Tensor _output{};
- NEFullyConnectedLayerReshapeWeights _func{};
+ static constexpr uint32_t _uid = 0x0;
+ Tensor _output{};
+ NETranspose _func{};
};
} // namespace weights_transformations
/** Basic function to compute a Fully Connected layer. This function calls the following kernels:
* -# @ref NEIm2ColKernel (called when the input comes from a convolutional layer)
- * -# @ref NEFullyConnectedLayerReshapeWeights (if @p are_weights_reshaped is set to false and transpose_weights is set to true ) (called once)
+ * -# @ref NETranspose (if @p are_weights_reshaped is set to false and transpose_weights is set to true ) (called once)
* -# @ref NEGEMMMatrixMultiplyKernel or @ref NEGEMMLowpMatrixMultiplyCore (if quantized asymmetric)
* -# @ref NEGEMMMatrixAdditionKernel or @ref NEGEMMLowpQuantizeDownInt32ToUint8ScaleByFixedPoint (if quantized asymmetric) (if @p biases is not equal to nullptr)
*
@@ -189,7 +149,7 @@ private:
NEFlattenLayer _flatten;
NEConvertFullyConnectedWeights _convert_weights;
weights_transformations::NEConvertFullyConnectedWeightsManaged _convert_weights_managed;
- NEFullyConnectedLayerReshapeWeights _reshape_weights_function;
+ NETranspose _reshape_weights_function;
weights_transformations::NEFullyConnectedLayerReshapeWeightsManaged _reshape_weights_managed_function;
NEGEMM _mm_gemm;
NEGEMMLowpMatrixMultiplyCore _mm_gemmlowp;