aboutsummaryrefslogtreecommitdiff
path: root/src/armnnUtils/ParserPrototxtFixture.hpp
diff options
context:
space:
mode:
authorColm Donelan <Colm.Donelan@arm.com>2020-09-09 12:48:16 +0100
committerTeresaARM <teresa.charlinreyes@arm.com>2020-10-02 15:30:11 +0000
commit5b5c222f6b0c40a8e0f9ef9dedccd6f0f18c4c2c (patch)
tree6ad0552e5efeb7ae3474a7f5019bc2fb33fced03 /src/armnnUtils/ParserPrototxtFixture.hpp
parent24ac85943b609e48fc36d16570ca4b5b90d31a6a (diff)
downloadarmnn-5b5c222f6b0c40a8e0f9ef9dedccd6f0f18c4c2c.tar.gz
IVGCVSW-5297 Remove boost::format from rest of ArmNN.
* Replacing calls to boost:format with fmt:format. * TensorUtils.cpp added outputShape.reserve call. Signed-off-by: Colm Donelan <Colm.Donelan@arm.com> Change-Id: I4b2ed0f72039df824a2adca9309b8a9bbb158c5b
Diffstat (limited to 'src/armnnUtils/ParserPrototxtFixture.hpp')
-rw-r--r--src/armnnUtils/ParserPrototxtFixture.hpp57
1 files changed, 27 insertions, 30 deletions
diff --git a/src/armnnUtils/ParserPrototxtFixture.hpp b/src/armnnUtils/ParserPrototxtFixture.hpp
index 8356117e1f..cf28fcf513 100644
--- a/src/armnnUtils/ParserPrototxtFixture.hpp
+++ b/src/armnnUtils/ParserPrototxtFixture.hpp
@@ -6,13 +6,13 @@
#pragma once
#include <armnn/IRuntime.hpp>
-
#include <test/TensorHelpers.hpp>
#include <Network.hpp>
#include <VerificationHelpers.hpp>
#include <boost/format.hpp>
+#include <fmt/format.h>
#include <iomanip>
#include <string>
@@ -129,10 +129,9 @@ void ParserPrototxtFixture<TParser>::Setup(const std::map<std::string, armnn::Te
armnn::Status ret = m_Runtime->LoadNetwork(m_NetworkIdentifier, move(optimized), errorMessage);
if (ret != armnn::Status::Success)
{
- throw armnn::Exception(boost::str(
- boost::format("LoadNetwork failed with error: '%1%' %2%")
- % errorMessage
- % CHECK_LOCATION().AsString()));
+ throw armnn::Exception(fmt::format("LoadNetwork failed with error: '{0}' {1}",
+ errorMessage,
+ CHECK_LOCATION().AsString()));
}
}
@@ -147,10 +146,9 @@ void ParserPrototxtFixture<TParser>::Setup()
armnn::Status ret = m_Runtime->LoadNetwork(m_NetworkIdentifier, move(optimized), errorMessage);
if (ret != armnn::Status::Success)
{
- throw armnn::Exception(boost::str(
- boost::format("LoadNetwork failed with error: '%1%' %2%")
- % errorMessage
- % CHECK_LOCATION().AsString()));
+ throw armnn::Exception(fmt::format("LoadNetwork failed with error: '{0}' {1}",
+ errorMessage,
+ CHECK_LOCATION().AsString()));
}
}
@@ -214,13 +212,12 @@ void ParserPrototxtFixture<TParser>::RunTest(const std::map<std::string, std::ve
armnn::BindingPointInfo bindingInfo = m_Parser->GetNetworkOutputBindingInfo(it.first);
if (bindingInfo.second.GetNumElements() != it.second.size())
{
- throw armnn::Exception(
- boost::str(boost::format("Output tensor %1% is expected to have %2% elements. "
- "%3% elements supplied. %4%") %
- it.first %
- bindingInfo.second.GetNumElements() %
- it.second.size() %
- CHECK_LOCATION().AsString()));
+ throw armnn::Exception(fmt::format("Output tensor {0} is expected to have {1} elements. "
+ "{2} elements supplied. {3}",
+ it.first,
+ bindingInfo.second.GetNumElements(),
+ it.second.size(),
+ CHECK_LOCATION().AsString()));
}
// If the expected output shape is set, the output tensor checks will be carried out.
@@ -234,25 +231,25 @@ void ParserPrototxtFixture<TParser>::RunTest(const std::map<std::string, std::ve
{
if (m_SingleOutputShape[i] != bindingInfo.second.GetShape()[i])
{
- throw armnn::Exception(
- boost::str(boost::format("Output tensor %1% is expected to have %2% shape. "
- "%3% shape supplied. %4%") %
- it.first %
- bindingInfo.second.GetShape() %
- m_SingleOutputShape %
- CHECK_LOCATION().AsString()));
+ // This exception message could not be created by fmt:format because of an oddity in
+ // the operator << of TensorShape.
+ std::stringstream message;
+ message << "Output tensor " << it.first << " is expected to have "
+ << bindingInfo.second.GetShape() << "shape. "
+ << m_SingleOutputShape << " shape supplied. "
+ << CHECK_LOCATION().AsString();
+ throw armnn::Exception(message.str());
}
}
}
else
{
- throw armnn::Exception(
- boost::str(boost::format("Output tensor %1% is expected to have %2% dimensions. "
- "%3% dimensions supplied. %4%") %
- it.first %
- bindingInfo.second.GetShape().GetNumDimensions() %
- NumOutputDimensions %
- CHECK_LOCATION().AsString()));
+ throw armnn::Exception(fmt::format("Output tensor {0} is expected to have {1} dimensions. "
+ "{2} dimensions supplied. {3}",
+ it.first,
+ bindingInfo.second.GetShape().GetNumDimensions(),
+ NumOutputDimensions,
+ CHECK_LOCATION().AsString()));
}
}