aboutsummaryrefslogtreecommitdiff
path: root/src/armnnUtils
diff options
context:
space:
mode:
authornarpra01 <narumol.prangnawarat@arm.com>2018-12-21 18:30:00 +0000
committerLes Bell <les.bell@arm.com>2019-01-02 09:25:42 +0000
commit6f37f83a27160948fee366b9f195c52f78cb88f0 (patch)
treed09a8d5769c3ac2c8f45660d305e9a6124716310 /src/armnnUtils
parentc48ac8c8cea1748ebfef15144f070799d4a129c3 (diff)
downloadarmnn-6f37f83a27160948fee366b9f195c52f78cb88f0.tar.gz
IVGCVSW-2353 Ignore control inputs in TensorFlow parser
* Allow control inputs from TensorFlow graph but ignore them in ArmNN graph. * Add utility function to test ArmNN graph structure. * Add ArmNN graph structure tests in TensorFlow paresr to ensure that control inputs are ignored in ArmNN graph as well as their inputs that are not used anywhere else. Change-Id: Ib0ea0d2df85e3fc79b748fa4c9d20e0649352bc1
Diffstat (limited to 'src/armnnUtils')
-rw-r--r--src/armnnUtils/ParserPrototxtFixture.hpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/armnnUtils/ParserPrototxtFixture.hpp b/src/armnnUtils/ParserPrototxtFixture.hpp
index 669b1fd0ca..fa21aba479 100644
--- a/src/armnnUtils/ParserPrototxtFixture.hpp
+++ b/src/armnnUtils/ParserPrototxtFixture.hpp
@@ -6,10 +6,12 @@
#pragma once
#include <armnn/IRuntime.hpp>
+
#include <test/TensorHelpers.hpp>
#include <armnnOnnxParser/IOnnxParser.hpp>
+#include <Network.hpp>
#include <VerificationHelpers.hpp>
#include <backendsCommon/BackendRegistry.hpp>
@@ -40,6 +42,9 @@ struct ParserPrototxtFixture
void Setup(const std::map<std::string, armnn::TensorShape>& inputShapes,
const std::vector<std::string>& requestedOutputs);
void Setup();
+ armnn::IOptimizedNetworkPtr SetupOptimizedNetwork(
+ const std::map<std::string,armnn::TensorShape>& inputShapes,
+ const std::vector<std::string>& requestedOutputs);
/// @}
/// Executes the network with the given input tensor and checks the result against the given output tensor.
@@ -125,6 +130,17 @@ void ParserPrototxtFixture<TParser>::Setup()
}
template<typename TParser>
+armnn::IOptimizedNetworkPtr ParserPrototxtFixture<TParser>::SetupOptimizedNetwork(
+ const std::map<std::string,armnn::TensorShape>& inputShapes,
+ const std::vector<std::string>& requestedOutputs)
+{
+ armnn::INetworkPtr network =
+ m_Parser->CreateNetworkFromString(m_Prototext.c_str(), inputShapes, requestedOutputs);
+ auto optimized = Optimize(*network, { armnn::Compute::CpuRef }, m_Runtime->GetDeviceSpec());
+ return optimized;
+}
+
+template<typename TParser>
template <std::size_t NumOutputDimensions>
void ParserPrototxtFixture<TParser>::RunTest(const std::vector<float>& inputData,
const std::vector<float>& expectedOutputData)