From 0663d66c64d8f1cb2b6158f9018c9ba19e2c504b Mon Sep 17 00:00:00 2001 From: Matthew Sloyan Date: Mon, 14 Sep 2020 11:47:26 +0100 Subject: IVGCVSW-5303 Remove some boost::numeric_cast from rest of ArmNN * Replaced with armnn/utility/NumericCast.hpp * Exclusions in TypeUtils.cpp and QuantizerVisitor.cpp * Excluded as requires float implementation in NumericCast.hpp Signed-off-by: Matthew Sloyan Change-Id: I5c4c60e7028e1a51bf9379457278d253fd37bc70 --- src/armnnUtils/TensorUtils.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/armnnUtils/TensorUtils.cpp') diff --git a/src/armnnUtils/TensorUtils.cpp b/src/armnnUtils/TensorUtils.cpp index 952c76885a..adaf8114f1 100644 --- a/src/armnnUtils/TensorUtils.cpp +++ b/src/armnnUtils/TensorUtils.cpp @@ -7,9 +7,9 @@ #include #include +#include #include -#include using namespace armnn; @@ -86,7 +86,7 @@ TensorShape ExpandDims(const TensorShape& tensorShape, int axis) { unsigned int outputDim = tensorShape.GetNumDimensions() + 1; - if (axis < -boost::numeric_cast(outputDim) || axis > boost::numeric_cast(tensorShape.GetNumDimensions())) + if (axis < -armnn::numeric_cast(outputDim) || axis > armnn::numeric_cast(tensorShape.GetNumDimensions())) { throw InvalidArgumentException( boost::str(boost::format("Invalid expansion axis %1% for %2%D input tensor. %3%") % @@ -97,7 +97,7 @@ TensorShape ExpandDims(const TensorShape& tensorShape, int axis) if (axis < 0) { - axis = boost::numeric_cast(outputDim) + axis; + axis = armnn::numeric_cast(outputDim) + axis; } std::vector outputShape; @@ -126,14 +126,14 @@ unsigned int GetNumElementsBetween(const TensorShape& shape, unsigned int GetUnsignedAxis(const unsigned int inputDimension, const int axis) { - ARMNN_ASSERT_MSG(axis < boost::numeric_cast(inputDimension), + ARMNN_ASSERT_MSG(axis < armnn::numeric_cast(inputDimension), "Required axis index greater than number of dimensions."); - ARMNN_ASSERT_MSG(axis >= -boost::numeric_cast(inputDimension), + ARMNN_ASSERT_MSG(axis >= -armnn::numeric_cast(inputDimension), "Required axis index lower than negative of the number of dimensions"); unsigned int uAxis = axis < 0 ? - inputDimension - boost::numeric_cast(abs(axis)) - : boost::numeric_cast(axis); + inputDimension - armnn::numeric_cast(abs(axis)) + : armnn::numeric_cast(axis); return uAxis; } -- cgit v1.2.1