From c2ebc63baf19ab6c3da6ae7a982c9eba0c0d85be Mon Sep 17 00:00:00 2001 From: Jim Flynn Date: Wed, 17 Apr 2019 10:16:58 +0100 Subject: IVGCVSW-2855 Update Command Line Processing of commonOptions Change-Id: I79f483b9854bd57cd712bc29b83983342cf8191f Signed-off-by: Jim Flynn --- tests/DeepSpeechV1Database.hpp | 8 +++++--- tests/DeepSpeechV1InferenceTest.hpp | 7 ++++--- 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'tests') diff --git a/tests/DeepSpeechV1Database.hpp b/tests/DeepSpeechV1Database.hpp index 4d2d591bed..274bf6e22f 100644 --- a/tests/DeepSpeechV1Database.hpp +++ b/tests/DeepSpeechV1Database.hpp @@ -70,20 +70,22 @@ auto ParseDataArray(std::istream& stream, const float& quantizationScale, const int32_t& quantizationOffset); +// NOTE: declaring the template specialisations inline to prevent them +// being flagged as unused functions when -Werror=unused-function is in effect template<> -auto ParseDataArray(std::istream & stream) +inline auto ParseDataArray(std::istream & stream) { return ParseArrayImpl(stream, [](const std::string& s) { return std::stof(s); }); } template<> -auto ParseDataArray(std::istream & stream) +inline auto ParseDataArray(std::istream & stream) { return ParseArrayImpl(stream, [](const std::string & s) { return std::stoi(s); }); } template<> -auto ParseDataArray(std::istream& stream, +inline auto ParseDataArray(std::istream& stream, const float& quantizationScale, const int32_t& quantizationOffset) { diff --git a/tests/DeepSpeechV1InferenceTest.hpp b/tests/DeepSpeechV1InferenceTest.hpp index 24e7dac567..633176219c 100755 --- a/tests/DeepSpeechV1InferenceTest.hpp +++ b/tests/DeepSpeechV1InferenceTest.hpp @@ -124,7 +124,7 @@ public: Model::AddCommandLineOptions(options, m_ModelCommandLineOptions); } - virtual bool ProcessCommandLineOptions() override + virtual bool ProcessCommandLineOptions(const InferenceTestOptions &commonOptions) override { if (!ValidateDirectory(m_InputSeqDir)) { @@ -156,7 +156,7 @@ public: return false; } - m_Model = m_ConstructModel(m_ModelCommandLineOptions); + m_Model = m_ConstructModel(commonOptions, m_ModelCommandLineOptions); if (!m_Model) { return false; @@ -185,7 +185,8 @@ public: private: typename Model::CommandLineOptions m_ModelCommandLineOptions; - std::function(typename Model::CommandLineOptions)> m_ConstructModel; + std::function(const InferenceTestOptions&, + typename Model::CommandLineOptions)> m_ConstructModel; std::unique_ptr m_Model; std::string m_InputSeqDir; -- cgit v1.2.1