aboutsummaryrefslogtreecommitdiff
path: root/src/armnnTfLiteParser/TfLiteParser.hpp
diff options
context:
space:
mode:
authorMatteo Martincigh <matteo.martincigh@arm.com>2018-12-18 09:26:39 +0000
committerMatteo Martincigh <matteo.martincigh@arm.com>2019-01-04 17:28:07 +0000
commit747ef82c88f9afe14a8b80b6b3b34118353e97f2 (patch)
treea29ac33b84fb96a41103a0a97327189495374cc9 /src/armnnTfLiteParser/TfLiteParser.hpp
parent760892724d131c7da4b9baad05cddd49276ad6bb (diff)
downloadarmnn-747ef82c88f9afe14a8b80b6b3b34118353e97f2.tar.gz
MLCE-77 Depthwise Convolution with depth multiplier > 1 doesn't work
* Unified ArmNN's weight format to [ M, I, H, W ] for the depthwise convolution * Added conversion utilities to permute/reshape the weights as appropriate when using CL and Neon backends * Updated the reference implementation of the convolution * Updated the relevant unit tests accordingly !android-nn-driver:459 Change-Id: I07d0818efa9d1ca1e5dad82983aac1fe78eadb18
Diffstat (limited to 'src/armnnTfLiteParser/TfLiteParser.hpp')
-rw-r--r--src/armnnTfLiteParser/TfLiteParser.hpp32
1 files changed, 23 insertions, 9 deletions
diff --git a/src/armnnTfLiteParser/TfLiteParser.hpp b/src/armnnTfLiteParser/TfLiteParser.hpp
index e7a7469f1f..9195728ad9 100644
--- a/src/armnnTfLiteParser/TfLiteParser.hpp
+++ b/src/armnnTfLiteParser/TfLiteParser.hpp
@@ -129,17 +129,31 @@ private:
// We don't care about the content, and we want a single datatype to simplify the code.
struct SupportedDataStorage
{
- std::unique_ptr<float[]> m_FloatData;
- std::unique_ptr<uint8_t[]> m_Uint8Data;
- std::unique_ptr<int32_t[]> m_Int32Data;
-
- SupportedDataStorage(std::unique_ptr<float[]> && data);
- SupportedDataStorage(std::unique_ptr<uint8_t[]> && data);
- SupportedDataStorage(std::unique_ptr<int32_t[]> && data);
+ public:
+ // Convenience constructors
+ SupportedDataStorage(std::unique_ptr<float[]>&& data);
+ SupportedDataStorage(std::unique_ptr<uint8_t[]>&& data);
+ SupportedDataStorage(std::unique_ptr<int32_t[]>&& data);
+
+ private:
+ // Pointers to the data buffers
+ std::unique_ptr<float[]> m_FloatData;
+ std::unique_ptr<uint8_t[]> m_Uint8Data;
+ std::unique_ptr<int32_t[]> m_Int32Data;
};
- std::pair<armnn::ConstTensor, SupportedDataStorage> CreateConstTensor(TensorRawPtr tensorPtr,
- armnn::TensorInfo & tensorInfo);
+
+ template<typename T>
+ std::pair<armnn::ConstTensor, TfLiteParser::SupportedDataStorage>
+ CreateConstTensorAndStoreData(TfLiteParser::BufferRawPtr bufferPtr,
+ TfLiteParser::TensorRawPtr tensorPtr,
+ armnn::TensorInfo& tensorInfo,
+ armnn::Optional<armnn::PermutationVector&> permutationVector);
+
+ std::pair<armnn::ConstTensor, SupportedDataStorage>
+ CreateConstTensor(TensorRawPtr tensorPtr,
+ armnn::TensorInfo& tensorInfo,
+ armnn::Optional<armnn::PermutationVector&> permutationVector);
/// The network we're building. Gets cleared after it is passed to the user
armnn::INetworkPtr m_Network;