aboutsummaryrefslogtreecommitdiff
path: root/src/backends/backendsCommon/test/layerTests/LstmTestImpl.cpp
diff options
context:
space:
mode:
authorMatthew Sloyan <matthew.sloyan@arm.com>2020-09-09 09:07:37 +0100
committerJan Eilers <jan.eilers@arm.com>2020-09-17 08:31:09 +0000
commit171214c8ff275c90cd4f7fc23a34ec2c83b5ea39 (patch)
tree23fd3ee288d631c8c94bede71f89f0f1e12da862 /src/backends/backendsCommon/test/layerTests/LstmTestImpl.cpp
parenta25886e0966a6b9433cd23595688fadb88a161b2 (diff)
downloadarmnn-171214c8ff275c90cd4f7fc23a34ec2c83b5ea39.tar.gz
IVGCVSW-5300 Remove some boost::numeric_cast from armnn/backends
* Replaced with armnn/utility/NumericCast.hpp * Some exclusions in reference backend * Excluded as requires float implementation in NumericCast.hpp Signed-off-by: Matthew Sloyan <matthew.sloyan@arm.com> Change-Id: I9e4e9cd502c865452128fa04415fd6f250baa855
Diffstat (limited to 'src/backends/backendsCommon/test/layerTests/LstmTestImpl.cpp')
-rw-r--r--src/backends/backendsCommon/test/layerTests/LstmTestImpl.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/backends/backendsCommon/test/layerTests/LstmTestImpl.cpp b/src/backends/backendsCommon/test/layerTests/LstmTestImpl.cpp
index 8f39f42452..088ca3b4c2 100644
--- a/src/backends/backendsCommon/test/layerTests/LstmTestImpl.cpp
+++ b/src/backends/backendsCommon/test/layerTests/LstmTestImpl.cpp
@@ -7,6 +7,7 @@
#include <QuantizeHelper.hpp>
+#include <armnn/utility/NumericCast.hpp>
#include <backendsCommon/CpuTensorHandle.hpp>
@@ -144,9 +145,9 @@ LstmNoCifgNoPeepholeNoProjectionTestImpl(
armnn::DataType constantDataType = armnn::DataType::Float32)
{
IgnoreUnused(memoryManager);
- unsigned int batchSize = boost::numeric_cast<unsigned int>(input.shape()[0]);
- unsigned int inputSize = boost::numeric_cast<unsigned int>(input.shape()[1]);
- unsigned int outputSize = boost::numeric_cast<unsigned int>(outputExpected.shape()[1]);
+ unsigned int batchSize = armnn::numeric_cast<unsigned int>(input.shape()[0]);
+ unsigned int inputSize = armnn::numeric_cast<unsigned int>(input.shape()[1]);
+ unsigned int outputSize = armnn::numeric_cast<unsigned int>(outputExpected.shape()[1]);
// cellSize and outputSize have the same size when there is no projection.
unsigned numUnits = outputSize;
@@ -1069,10 +1070,10 @@ LayerTestResult<T, 2> LstmLayerWithCifgWithPeepholeNoProjectionTestImpl(
bool peepholeEnabled = true;
bool projectionEnabled = false;
// These are not the input and the output of Lstm yet
- unsigned int batchSize = boost::numeric_cast<unsigned int>(input.shape()[0]);
- unsigned int inputSize = boost::numeric_cast<unsigned int>(input.shape()[1]);
+ unsigned int batchSize = armnn::numeric_cast<unsigned int>(input.shape()[0]);
+ unsigned int inputSize = armnn::numeric_cast<unsigned int>(input.shape()[1]);
- unsigned int outputSize = boost::numeric_cast<unsigned int>(outputExpected.shape()[1]);
+ unsigned int outputSize = armnn::numeric_cast<unsigned int>(outputExpected.shape()[1]);
const unsigned int cellSize = outputSize;
@@ -1560,9 +1561,9 @@ LayerTestResult<uint8_t, 2> QuantizedLstmTestImpl(
const boost::multi_array<uint8_t, 2>& outputExpected)
{
IgnoreUnused(memoryManager);
- auto numBatches = boost::numeric_cast<unsigned int>(input.shape()[0]);
- auto inputSize = boost::numeric_cast<unsigned int>(input.shape()[1]);
- auto outputSize = boost::numeric_cast<unsigned int>(outputExpected.shape()[1]);
+ auto numBatches = armnn::numeric_cast<unsigned int>(input.shape()[0]);
+ auto inputSize = armnn::numeric_cast<unsigned int>(input.shape()[1]);
+ auto outputSize = armnn::numeric_cast<unsigned int>(outputExpected.shape()[1]);
// Scale/Offset for input/output, cellState In/Out, weights, bias
float inputOutputScale = 0.0078125f;