diff options
Diffstat (limited to 'src/armnn/layers')
49 files changed, 175 insertions, 177 deletions
diff --git a/src/armnn/layers/AbsLayer.cpp b/src/armnn/layers/AbsLayer.cpp index f67d965086..490b03ed79 100644 --- a/src/armnn/layers/AbsLayer.cpp +++ b/src/armnn/layers/AbsLayer.cpp @@ -36,7 +36,7 @@ void AbsLayer::ValidateTensorShapesFromInputs() auto inferredShapes = InferOutputShapes({ GetInputSlot(0).GetConnection()->GetTensorInfo().GetShape() }); - BOOST_ASSERT(inferredShapes.size() == 1); + ARMNN_ASSERT(inferredShapes.size() == 1); ConditionalThrowIfNotEqual<LayerValidationException>( "AbsLayer: TensorShape set on OutputSlot[0] does not match the inferred shape.", diff --git a/src/armnn/layers/ActivationLayer.cpp b/src/armnn/layers/ActivationLayer.cpp index 263fb72c20..d310b7efbc 100644 --- a/src/armnn/layers/ActivationLayer.cpp +++ b/src/armnn/layers/ActivationLayer.cpp @@ -34,7 +34,7 @@ void ActivationLayer::ValidateTensorShapesFromInputs() auto inferredShapes = InferOutputShapes({ GetInputSlot(0).GetConnection()->GetTensorInfo().GetShape() }); - BOOST_ASSERT(inferredShapes.size() == 1); + ARMNN_ASSERT(inferredShapes.size() == 1); ConditionalThrowIfNotEqual<LayerValidationException>( "ActivationLayer: TensorShape set on OutputSlot[0] does not match the inferred shape.", diff --git a/src/armnn/layers/ArgMinMaxLayer.cpp b/src/armnn/layers/ArgMinMaxLayer.cpp index b67c42b2e4..a9907871be 100644 --- a/src/armnn/layers/ArgMinMaxLayer.cpp +++ b/src/armnn/layers/ArgMinMaxLayer.cpp @@ -34,7 +34,7 @@ ArgMinMaxLayer* ArgMinMaxLayer::Clone(Graph& graph) const std::vector<TensorShape> ArgMinMaxLayer::InferOutputShapes(const std::vector<TensorShape>& inputShapes) const { - BOOST_ASSERT(inputShapes.size() == 1); + ARMNN_ASSERT(inputShapes.size() == 1); TensorShape inputShape = inputShapes[0]; auto inputNumDimensions = inputShape.GetNumDimensions(); @@ -42,7 +42,7 @@ std::vector<TensorShape> ArgMinMaxLayer::InferOutputShapes(const std::vector<Ten auto axis = m_Param.m_Axis; auto unsignedAxis = armnnUtils::GetUnsignedAxis(inputNumDimensions, axis); - BOOST_ASSERT(unsignedAxis <= inputNumDimensions); + ARMNN_ASSERT(unsignedAxis <= inputNumDimensions); // 1D input shape results in scalar output if (inputShape.GetNumDimensions() == 1) @@ -75,7 +75,7 @@ void ArgMinMaxLayer::ValidateTensorShapesFromInputs() auto inferredShapes = InferOutputShapes({ GetInputSlot(0).GetConnection()->GetTensorInfo().GetShape() }); - BOOST_ASSERT(inferredShapes.size() == 1); + ARMNN_ASSERT(inferredShapes.size() == 1); ConditionalThrowIfNotEqual<LayerValidationException>( "ArgMinMaxLayer: TensorShape set on OutputSlot does not match the inferred shape.", diff --git a/src/armnn/layers/BatchNormalizationLayer.cpp b/src/armnn/layers/BatchNormalizationLayer.cpp index aed744714b..7f61cad40f 100644 --- a/src/armnn/layers/BatchNormalizationLayer.cpp +++ b/src/armnn/layers/BatchNormalizationLayer.cpp @@ -21,10 +21,10 @@ BatchNormalizationLayer::BatchNormalizationLayer(const armnn::BatchNormalization std::unique_ptr<IWorkload> BatchNormalizationLayer::CreateWorkload(const IWorkloadFactory& factory) const { // on this level constant data should not be released.. - BOOST_ASSERT_MSG(m_Mean != nullptr, "BatchNormalizationLayer: Mean data should not be null."); - BOOST_ASSERT_MSG(m_Variance != nullptr, "BatchNormalizationLayer: Variance data should not be null."); - BOOST_ASSERT_MSG(m_Beta != nullptr, "BatchNormalizationLayer: Beta data should not be null."); - BOOST_ASSERT_MSG(m_Gamma != nullptr, "BatchNormalizationLayer: Gamma data should not be null."); + ARMNN_ASSERT_MSG(m_Mean != nullptr, "BatchNormalizationLayer: Mean data should not be null."); + ARMNN_ASSERT_MSG(m_Variance != nullptr, "BatchNormalizationLayer: Variance data should not be null."); + ARMNN_ASSERT_MSG(m_Beta != nullptr, "BatchNormalizationLayer: Beta data should not be null."); + ARMNN_ASSERT_MSG(m_Gamma != nullptr, "BatchNormalizationLayer: Gamma data should not be null."); BatchNormalizationQueueDescriptor descriptor; @@ -54,7 +54,7 @@ void BatchNormalizationLayer::ValidateTensorShapesFromInputs() auto inferredShapes = InferOutputShapes({ GetInputSlot(0).GetConnection()->GetTensorInfo().GetShape() }); - BOOST_ASSERT(inferredShapes.size() == 1); + ARMNN_ASSERT(inferredShapes.size() == 1); ConditionalThrowIfNotEqual<LayerValidationException>( "BatchNormalizationLayer: TensorShape set on OutputSlot[0] does not match the inferred shape.", diff --git a/src/armnn/layers/BatchToSpaceNdLayer.cpp b/src/armnn/layers/BatchToSpaceNdLayer.cpp index 7e7045291c..1da88c63ac 100644 --- a/src/armnn/layers/BatchToSpaceNdLayer.cpp +++ b/src/armnn/layers/BatchToSpaceNdLayer.cpp @@ -47,7 +47,7 @@ void BatchToSpaceNdLayer::ValidateTensorShapesFromInputs() auto inferredShapes = InferOutputShapes({GetInputSlot(0).GetConnection()->GetTensorInfo().GetShape()}); - BOOST_ASSERT(inferredShapes.size() == 1); + ARMNN_ASSERT(inferredShapes.size() == 1); ConditionalThrowIfNotEqual<LayerValidationException>( "BatchToSpaceLayer: TensorShape set on OutputSlot[0] does not match the inferred shape.", @@ -56,7 +56,7 @@ void BatchToSpaceNdLayer::ValidateTensorShapesFromInputs() std::vector<TensorShape> BatchToSpaceNdLayer::InferOutputShapes(const std::vector<TensorShape>& inputShapes) const { - BOOST_ASSERT(inputShapes.size() == 1); + ARMNN_ASSERT(inputShapes.size() == 1); const TensorShape& inputShape = inputShapes[0]; TensorShape outputShape(inputShape); @@ -66,7 +66,7 @@ std::vector<TensorShape> BatchToSpaceNdLayer::InferOutputShapes(const std::vecto 1U, std::multiplies<>()); - BOOST_ASSERT(inputShape[0] % accumulatedBlockShape == 0); + ARMNN_ASSERT(inputShape[0] % accumulatedBlockShape == 0); outputShape[0] = inputShape[0] / accumulatedBlockShape; @@ -80,10 +80,10 @@ std::vector<TensorShape> BatchToSpaceNdLayer::InferOutputShapes(const std::vecto unsigned int outputHeight = inputShape[heightIndex] * m_Param.m_BlockShape[0]; unsigned int outputWidth = inputShape[widthIndex] * m_Param.m_BlockShape[1]; - BOOST_ASSERT_MSG(heightCrop <= outputHeight, + ARMNN_ASSERT_MSG(heightCrop <= outputHeight, "BatchToSpaceLayer: Overall height crop should be less than or equal to the uncropped output height."); - BOOST_ASSERT_MSG(widthCrop <= outputWidth, + ARMNN_ASSERT_MSG(widthCrop <= outputWidth, "BatchToSpaceLayer: Overall width crop should be less than or equal to the uncropped output width."); outputShape[heightIndex] = outputHeight - heightCrop; diff --git a/src/armnn/layers/ComparisonLayer.cpp b/src/armnn/layers/ComparisonLayer.cpp index 1f6e35fa85..91080457bf 100644 --- a/src/armnn/layers/ComparisonLayer.cpp +++ b/src/armnn/layers/ComparisonLayer.cpp @@ -33,11 +33,11 @@ ComparisonLayer* ComparisonLayer::Clone(Graph& graph) const std::vector<TensorShape> ComparisonLayer::InferOutputShapes(const std::vector<TensorShape>& inputShapes) const { - BOOST_ASSERT(inputShapes.size() == 2); + ARMNN_ASSERT(inputShapes.size() == 2); const TensorShape& input0 = inputShapes[0]; const TensorShape& input1 = inputShapes[1]; - BOOST_ASSERT(input0.GetNumDimensions() == input1.GetNumDimensions()); + ARMNN_ASSERT(input0.GetNumDimensions() == input1.GetNumDimensions()); unsigned int numDims = input0.GetNumDimensions(); std::vector<unsigned int> dims(numDims); @@ -46,7 +46,7 @@ std::vector<TensorShape> ComparisonLayer::InferOutputShapes(const std::vector<Te unsigned int dim0 = input0[i]; unsigned int dim1 = input1[i]; - BOOST_ASSERT_MSG(dim0 == dim1 || dim0 == 1 || dim1 == 1, + ARMNN_ASSERT_MSG(dim0 == dim1 || dim0 == 1 || dim1 == 1, "Dimensions should either match or one should be of size 1."); dims[i] = std::max(dim0, dim1); @@ -63,7 +63,7 @@ void ComparisonLayer::ValidateTensorShapesFromInputs() GetInputSlot(0).GetConnection()->GetTensorInfo().GetShape(), GetInputSlot(1).GetConnection()->GetTensorInfo().GetShape() }); - BOOST_ASSERT(inferredShapes.size() == 1); + ARMNN_ASSERT(inferredShapes.size() == 1); ConditionalThrowIfNotEqual<LayerValidationException>( "ComparisonLayer: TensorShape set on OutputSlot[0] does not match the inferred shape.", diff --git a/src/armnn/layers/ConcatLayer.cpp b/src/armnn/layers/ConcatLayer.cpp index f4024af65a..5df5ec8de5 100644 --- a/src/armnn/layers/ConcatLayer.cpp +++ b/src/armnn/layers/ConcatLayer.cpp @@ -111,7 +111,7 @@ void ConcatLayer::CreateTensors(const FactoryType& factory) OutputSlot* slot = currentLayer->GetInputSlot(i).GetConnectedOutputSlot(); OutputHandler& outputHandler = slot->GetOutputHandler(); - BOOST_ASSERT_MSG(subTensor, "ConcatLayer: Expected a valid sub-tensor for substitution."); + ARMNN_ASSERT_MSG(subTensor, "ConcatLayer: Expected a valid sub-tensor for substitution."); outputHandler.SetData(std::move(subTensor)); Layer& inputLayer = slot->GetOwningLayer(); @@ -141,7 +141,7 @@ void ConcatLayer::CreateTensorHandles(const TensorHandleFactoryRegistry& registr else { ITensorHandleFactory* handleFactory = registry.GetFactory(factoryId); - BOOST_ASSERT(handleFactory); + ARMNN_ASSERT(handleFactory); CreateTensors(*handleFactory); } } @@ -153,7 +153,7 @@ ConcatLayer* ConcatLayer::Clone(Graph& graph) const std::vector<TensorShape> ConcatLayer::InferOutputShapes(const std::vector<TensorShape>& inputShapes) const { - BOOST_ASSERT(inputShapes.size() == m_Param.GetNumViews()); + ARMNN_ASSERT(inputShapes.size() == m_Param.GetNumViews()); unsigned int numDims = m_Param.GetNumDimensions(); for (unsigned int i=0; i< inputShapes.size(); i++) @@ -259,7 +259,7 @@ void ConcatLayer::ValidateTensorShapesFromInputs() auto inferredShapes = InferOutputShapes(inputShapes); - BOOST_ASSERT(inferredShapes.size() == 1); + ARMNN_ASSERT(inferredShapes.size() == 1); ConditionalThrowIfNotEqual<LayerValidationException>( "ConcatLayer: TensorShape set on OutputSlot[0] does not match the inferred shape.", diff --git a/src/armnn/layers/ConvertBf16ToFp32Layer.cpp b/src/armnn/layers/ConvertBf16ToFp32Layer.cpp index 147aa8f46a..30d20b87d6 100644 --- a/src/armnn/layers/ConvertBf16ToFp32Layer.cpp +++ b/src/armnn/layers/ConvertBf16ToFp32Layer.cpp @@ -36,7 +36,7 @@ void ConvertBf16ToFp32Layer::ValidateTensorShapesFromInputs() auto inferredShapes = InferOutputShapes({ GetInputSlot(0).GetConnection()->GetTensorInfo().GetShape() }); - BOOST_ASSERT(inferredShapes.size() == 1); + ARMNN_ASSERT(inferredShapes.size() == 1); ConditionalThrowIfNotEqual<LayerValidationException>( "ConvertBf16ToFp32Layer: TensorShape set on OutputSlot[0] does not match the inferred shape.", diff --git a/src/armnn/layers/ConvertFp16ToFp32Layer.cpp b/src/armnn/layers/ConvertFp16ToFp32Layer.cpp index 7873c94563..08f0e4a8c1 100644 --- a/src/armnn/layers/ConvertFp16ToFp32Layer.cpp +++ b/src/armnn/layers/ConvertFp16ToFp32Layer.cpp @@ -36,7 +36,7 @@ void ConvertFp16ToFp32Layer::ValidateTensorShapesFromInputs() auto inferredShapes = InferOutputShapes({ GetInputSlot(0).GetConnection()->GetTensorInfo().GetShape() }); - BOOST_ASSERT(inferredShapes.size() == 1); + ARMNN_ASSERT(inferredShapes.size() == 1); ConditionalThrowIfNotEqual<LayerValidationException>( "ConvertFp16ToFp32Layer: TensorShape set on OutputSlot[0] does not match the inferred shape.", diff --git a/src/armnn/layers/ConvertFp32ToBf16Layer.cpp b/src/armnn/layers/ConvertFp32ToBf16Layer.cpp index 936acf61ab..c9e0962dd5 100644 --- a/src/armnn/layers/ConvertFp32ToBf16Layer.cpp +++ b/src/armnn/layers/ConvertFp32ToBf16Layer.cpp @@ -36,7 +36,7 @@ void ConvertFp32ToBf16Layer::ValidateTensorShapesFromInputs() auto inferredShapes = InferOutputShapes({ GetInputSlot(0).GetConnection()->GetTensorInfo().GetShape() }); - BOOST_ASSERT(inferredShapes.size() == 1); + ARMNN_ASSERT(inferredShapes.size() == 1); ConditionalThrowIfNotEqual<LayerValidationException>( "ConvertFp32ToBf16Layer: TensorShape set on OutputSlot[0] does not match the inferred shape.", diff --git a/src/armnn/layers/ConvertFp32ToFp16Layer.cpp b/src/armnn/layers/ConvertFp32ToFp16Layer.cpp index bbf4dbffd8..95403e9e75 100644 --- a/src/armnn/layers/ConvertFp32ToFp16Layer.cpp +++ b/src/armnn/layers/ConvertFp32ToFp16Layer.cpp @@ -35,7 +35,7 @@ void ConvertFp32ToFp16Layer::ValidateTensorShapesFromInputs() auto inferredShapes = InferOutputShapes({ GetInputSlot(0).GetConnection()->GetTensorInfo().GetShape() }); - BOOST_ASSERT(inferredShapes.size() == 1); + ARMNN_ASSERT(inferredShapes.size() == 1); ConditionalThrowIfNotEqual<LayerValidationException>( "ConvertFp32ToFp16Layer: TensorShape set on OutputSlot[0] does not match the inferred shape.", diff --git a/src/armnn/layers/Convolution2dLayer.cpp b/src/armnn/layers/Convolution2dLayer.cpp index 55a243aa0b..d82908a128 100644 --- a/src/armnn/layers/Convolution2dLayer.cpp +++ b/src/armnn/layers/Convolution2dLayer.cpp @@ -49,7 +49,7 @@ void Convolution2dLayer::SerializeLayerParameters(ParameterStringifyFunction& fn std::unique_ptr<IWorkload> Convolution2dLayer::CreateWorkload(const IWorkloadFactory& factory) const { // on this level constant data should not be released.. - BOOST_ASSERT_MSG(m_Weight != nullptr, "Convolution2dLayer: Weights data should not be null."); + ARMNN_ASSERT_MSG(m_Weight != nullptr, "Convolution2dLayer: Weights data should not be null."); Convolution2dQueueDescriptor descriptor; @@ -57,7 +57,7 @@ std::unique_ptr<IWorkload> Convolution2dLayer::CreateWorkload(const IWorkloadFac if (m_Param.m_BiasEnabled) { - BOOST_ASSERT_MSG(m_Bias != nullptr, "Convolution2dLayer: Bias data should not be null."); + ARMNN_ASSERT_MSG(m_Bias != nullptr, "Convolution2dLayer: Bias data should not be null."); descriptor.m_Bias = m_Bias.get(); } return factory.CreateConvolution2d(descriptor, PrepInfoAndDesc(descriptor)); @@ -79,12 +79,12 @@ Convolution2dLayer* Convolution2dLayer::Clone(Graph& graph) const std::vector<TensorShape> Convolution2dLayer::InferOutputShapes(const std::vector<TensorShape>& inputShapes) const { - BOOST_ASSERT(inputShapes.size() == 2); + ARMNN_ASSERT(inputShapes.size() == 2); const TensorShape& inputShape = inputShapes[0]; const TensorShape filterShape = inputShapes[1]; // If we support multiple batch dimensions in the future, then this assert will need to change. - BOOST_ASSERT_MSG(inputShape.GetNumDimensions() == 4, "Convolutions will always have 4D input."); + ARMNN_ASSERT_MSG(inputShape.GetNumDimensions() == 4, "Convolutions will always have 4D input."); DataLayoutIndexed dataLayoutIndex(m_Param.m_DataLayout); @@ -117,13 +117,13 @@ void Convolution2dLayer::ValidateTensorShapesFromInputs() VerifyLayerConnections(1, CHECK_LOCATION()); // check if we m_Weight data is not nullptr - BOOST_ASSERT_MSG(m_Weight != nullptr, "Convolution2dLayer: Weights data should not be null."); + ARMNN_ASSERT_MSG(m_Weight != nullptr, "Convolution2dLayer: Weights data should not be null."); auto inferredShapes = InferOutputShapes({ GetInputSlot(0).GetConnection()->GetTensorInfo().GetShape(), m_Weight->GetTensorInfo().GetShape() }); - BOOST_ASSERT(inferredShapes.size() == 1); + ARMNN_ASSERT(inferredShapes.size() == 1); ConditionalThrowIfNotEqual<LayerValidationException>( "Convolution2dLayer: TensorShape set on OutputSlot[0] does not match the inferred shape.", diff --git a/src/armnn/layers/DebugLayer.cpp b/src/armnn/layers/DebugLayer.cpp index 76d33f27e9..6aaf945878 100644 --- a/src/armnn/layers/DebugLayer.cpp +++ b/src/armnn/layers/DebugLayer.cpp @@ -41,7 +41,7 @@ void DebugLayer::ValidateTensorShapesFromInputs() std::vector<TensorShape> inferredShapes = InferOutputShapes({ GetInputSlot(0).GetConnection()->GetTensorInfo().GetShape() }); - BOOST_ASSERT(inferredShapes.size() == 1); + ARMNN_ASSERT(inferredShapes.size() == 1); ConditionalThrowIfNotEqual<LayerValidationException>( "DebugLayer: TensorShape set on OutputSlot[0] does not match the inferred shape.", diff --git a/src/armnn/layers/DepthToSpaceLayer.cpp b/src/armnn/layers/DepthToSpaceLayer.cpp index bb74232690..2d13271c77 100644 --- a/src/armnn/layers/DepthToSpaceLayer.cpp +++ b/src/armnn/layers/DepthToSpaceLayer.cpp @@ -38,7 +38,7 @@ DepthToSpaceLayer* DepthToSpaceLayer::Clone(Graph& graph) const std::vector<TensorShape> DepthToSpaceLayer::InferOutputShapes(const std::vector<TensorShape>& inputShapes) const { - BOOST_ASSERT(inputShapes.size() == 1); + ARMNN_ASSERT(inputShapes.size() == 1); TensorShape inputShape = inputShapes[0]; TensorShape outputShape(inputShape); @@ -64,7 +64,7 @@ void DepthToSpaceLayer::ValidateTensorShapesFromInputs() std::vector<TensorShape> inferredShapes = InferOutputShapes({ GetInputSlot(0).GetConnection()->GetTensorInfo().GetShape() }); - BOOST_ASSERT(inferredShapes.size() == 1); + ARMNN_ASSERT(inferredShapes.size() == 1); ConditionalThrowIfNotEqual<LayerValidationException>( "DepthToSpaceLayer: TensorShape set on OutputSlot[0] does not match the inferred shape.", diff --git a/src/armnn/layers/DepthwiseConvolution2dLayer.cpp b/src/armnn/layers/DepthwiseConvolution2dLayer.cpp index f37096ac18..dc6b2c2fe7 100644 --- a/src/armnn/layers/DepthwiseConvolution2dLayer.cpp +++ b/src/armnn/layers/DepthwiseConvolution2dLayer.cpp @@ -51,7 +51,7 @@ void DepthwiseConvolution2dLayer::SerializeLayerParameters(ParameterStringifyFun std::unique_ptr<IWorkload> DepthwiseConvolution2dLayer::CreateWorkload(const IWorkloadFactory& factory) const { // on this level constant data should not be released.. - BOOST_ASSERT_MSG(m_Weight != nullptr, "DepthwiseConvolution2dLayer: Weights data should not be null."); + ARMNN_ASSERT_MSG(m_Weight != nullptr, "DepthwiseConvolution2dLayer: Weights data should not be null."); DepthwiseConvolution2dQueueDescriptor descriptor; @@ -59,7 +59,7 @@ std::unique_ptr<IWorkload> DepthwiseConvolution2dLayer::CreateWorkload(const IWo if (m_Param.m_BiasEnabled) { - BOOST_ASSERT_MSG(m_Bias != nullptr, "DepthwiseConvolution2dLayer: Bias data should not be null."); + ARMNN_ASSERT_MSG(m_Bias != nullptr, "DepthwiseConvolution2dLayer: Bias data should not be null."); descriptor.m_Bias = m_Bias.get(); } return factory.CreateDepthwiseConvolution2d(descriptor, PrepInfoAndDesc(descriptor)); @@ -81,11 +81,11 @@ DepthwiseConvolution2dLayer* DepthwiseConvolution2dLayer::Clone(Graph& graph) co std::vector<TensorShape> DepthwiseConvolution2dLayer::InferOutputShapes(const std::vector<TensorShape>& inputShapes) const { - BOOST_ASSERT(inputShapes.size() == 2); + ARMNN_ASSERT(inputShapes.size() == 2); const TensorShape& inputShape = inputShapes[0]; const TensorShape& filterShape = inputShapes[1]; - BOOST_ASSERT_MSG(inputShape.GetNumDimensions() == 4, "Convolutions will always have 4D input."); + ARMNN_ASSERT_MSG(inputShape.GetNumDimensions() == 4, "Convolutions will always have 4D input."); DataLayoutIndexed dataLayoutIndex(m_Param.m_DataLayout); @@ -124,14 +124,14 @@ void DepthwiseConvolution2dLayer::ValidateTensorShapesFromInputs() VerifyLayerConnections(1, CHECK_LOCATION()); // on this level constant data should not be released.. - BOOST_ASSERT_MSG(m_Weight != nullptr, "DepthwiseConvolution2dLayer: Weights data should not be null."); + ARMNN_ASSERT_MSG(m_Weight != nullptr, "DepthwiseConvolution2dLayer: Weights data should not be null."); auto inferredShapes = InferOutputShapes({ GetInputSlot(0).GetConnection()->GetTensorInfo().GetShape(), m_Weight->GetTensorInfo().GetShape() }); - BOOST_ASSERT(inferredShapes.size() == 1); + ARMNN_ASSERT(inferredShapes.size() == 1); ConditionalThrowIfNotEqual<LayerValidationException>( "DepthwiseConvolution2dLayer: TensorShape set on OutputSlot[0] does not match the inferred shape.", diff --git a/src/armnn/layers/DequantizeLayer.cpp b/src/armnn/layers/DequantizeLayer.cpp index 00a1d697b6..5b57279c43 100644 --- a/src/armnn/layers/DequantizeLayer.cpp +++ b/src/armnn/layers/DequantizeLayer.cpp @@ -36,7 +36,7 @@ void DequantizeLayer::ValidateTensorShapesFromInputs() std::vector<TensorShape> inferredShapes = InferOutputShapes({ GetInputSlot(0).GetConnection()->GetTensorInfo().GetShape() }); - BOOST_ASSERT(inferredShapes.size() == 1); + ARMNN_ASSERT(inferredShapes.size() == 1); ConditionalThrowIfNotEqual<LayerValidationException>( "DequantizeLayer: TensorShape set on OutputSlot[0] does not match the inferred shape.", diff --git a/src/armnn/layers/DetectionPostProcessLayer.cpp b/src/armnn/layers/DetectionPostProcessLayer.cpp index 8749b33ba2..e8d14d928c 100644 --- a/src/armnn/layers/DetectionPostProcessLayer.cpp +++ b/src/armnn/layers/DetectionPostProcessLayer.cpp @@ -39,9 +39,9 @@ void DetectionPostProcessLayer::ValidateTensorShapesFromInputs() VerifyLayerConnections(2, CHECK_LOCATION()); // on this level constant data should not be released. - BOOST_ASSERT_MSG(m_Anchors != nullptr, "DetectionPostProcessLayer: Anchors data should not be null."); + ARMNN_ASSERT_MSG(m_Anchors != nullptr, "DetectionPostProcessLayer: Anchors data should not be null."); - BOOST_ASSERT_MSG(GetNumOutputSlots() == 4, "DetectionPostProcessLayer: The layer should return 4 outputs."); + ARMNN_ASSERT_MSG(GetNumOutputSlots() == 4, "DetectionPostProcessLayer: The layer should return 4 outputs."); unsigned int detectedBoxes = m_Param.m_MaxDetections * m_Param.m_MaxClassesPerDetection; diff --git a/src/armnn/layers/ElementwiseBaseLayer.cpp b/src/armnn/layers/ElementwiseBaseLayer.cpp index 761814176d..2c1e8717f4 100644 --- a/src/armnn/layers/ElementwiseBaseLayer.cpp +++ b/src/armnn/layers/ElementwiseBaseLayer.cpp @@ -8,8 +8,7 @@ #include "InternalTypes.hpp" #include "armnn/Exceptions.hpp" #include <armnn/TypesUtils.hpp> - -#include <boost/assert.hpp> +#include <armnn/utility/Assert.hpp> namespace armnn { @@ -22,12 +21,12 @@ ElementwiseBaseLayer::ElementwiseBaseLayer(unsigned int numInputSlots, unsigned std::vector<TensorShape> ElementwiseBaseLayer::InferOutputShapes(const std::vector<TensorShape>& inputShapes) const { - BOOST_ASSERT(inputShapes.size() == 2); + ARMNN_ASSERT(inputShapes.size() == 2); auto& input0 = inputShapes[0]; auto& input1 = inputShapes[1]; // Get the max of the inputs. - BOOST_ASSERT(input0.GetNumDimensions() == input1.GetNumDimensions()); + ARMNN_ASSERT(input0.GetNumDimensions() == input1.GetNumDimensions()); unsigned int numDims = input0.GetNumDimensions(); std::vector<unsigned int> dims(numDims); @@ -38,7 +37,7 @@ std::vector<TensorShape> ElementwiseBaseLayer::InferOutputShapes(const std::vect #if !NDEBUG // Validate inputs are broadcast compatible. - BOOST_ASSERT_MSG(dim0 == dim1 || dim0 == 1 || dim1 == 1, + ARMNN_ASSERT_MSG(dim0 == dim1 || dim0 == 1 || dim1 == 1, "Dimensions should either match or one should be of size 1."); #endif @@ -57,7 +56,7 @@ void ElementwiseBaseLayer::ValidateTensorShapesFromInputs() GetInputSlot(1).GetConnection()->GetTensorInfo().GetShape() }); - BOOST_ASSERT(inferredShapes.size() == 1); + ARMNN_ASSERT(inferredShapes.size() == 1); std::string msg = GetLayerTypeAsCString(GetType()); msg += "Layer: TensorShape set on OutputSlot[0] does not match the inferred shape."; diff --git a/src/armnn/layers/ElementwiseUnaryLayer.cpp b/src/armnn/layers/ElementwiseUnaryLayer.cpp index d3843da060..c91057cc9f 100644 --- a/src/armnn/layers/ElementwiseUnaryLayer.cpp +++ b/src/armnn/layers/ElementwiseUnaryLayer.cpp @@ -34,7 +34,7 @@ ElementwiseUnaryLayer* ElementwiseUnaryLayer::Clone(Graph& graph) const std::vector<TensorShape> ElementwiseUnaryLayer::InferOutputShapes(const std::vector<TensorShape>& inputShapes) const { // Should return the shape of the input tensor - BOOST_ASSERT(inputShapes.size() == 1); + ARMNN_ASSERT(inputShapes.size() == 1); const TensorShape& input = inputShapes[0]; return std::vector<TensorShape>({ input }); @@ -46,7 +46,7 @@ void ElementwiseUnaryLayer::ValidateTensorShapesFromInputs() std::vector<TensorShape> inferredShapes = InferOutputShapes({ GetInputSlot(0).GetConnection()->GetTensorInfo().GetShape()}); - BOOST_ASSERT(inferredShapes.size() == 1); + ARMNN_ASSERT(inferredShapes.size() == 1); ConditionalThrowIfNotEqual<LayerValidationException>( "ElementwiseUnaryLayer: TensorShape set on OutputSlot[0] does not match the inferred shape.", diff --git a/src/armnn/layers/FakeQuantizationLayer.cpp b/src/armnn/layers/FakeQuantizationLayer.cpp index 8611b9b73c..2b4ad8605f 100644 --- a/src/armnn/layers/FakeQuantizationLayer.cpp +++ b/src/armnn/layers/FakeQuantizationLayer.cpp @@ -35,7 +35,7 @@ void FakeQuantizationLayer::ValidateTensorShapesFromInputs() auto inferredShapes = InferOutputShapes({ GetInputSlot(0).GetConnection()->GetTensorInfo().GetShape() }); - BOOST_ASSERT(inferredShapes.size() == 1); + ARMNN_ASSERT(inferredShapes.size() == 1); ConditionalThrowIfNotEqual<LayerValidationException>( "FakeQuantizationLayer: TensorShape set on OutputSlot[0] does not match the inferred shape.", diff --git a/src/armnn/layers/FloorLayer.cpp b/src/armnn/layers/FloorLayer.cpp index 148543cf62..fb918f6e7a 100644 --- a/src/armnn/layers/FloorLayer.cpp +++ b/src/armnn/layers/FloorLayer.cpp @@ -35,7 +35,7 @@ void FloorLayer::ValidateTensorShapesFromInputs() auto inferredShapes = InferOutputShapes({ GetInputSlot(0).GetConnection()->GetTensorInfo().GetShape() }); - BOOST_ASSERT(inferredShapes.size() == 1); + ARMNN_ASSERT(inferredShapes.size() == 1); ConditionalThrowIfNotEqual<LayerValidationException>( "FloorLayer: TensorShape set on OutputSlot[0] does not match the inferred shape.", diff --git a/src/armnn/layers/FullyConnectedLayer.cpp b/src/armnn/layers/FullyConnectedLayer.cpp index 6b36bad713..4bbc9ba890 100644 --- a/src/armnn/layers/FullyConnectedLayer.cpp +++ b/src/armnn/layers/FullyConnectedLayer.cpp @@ -22,14 +22,14 @@ FullyConnectedLayer::FullyConnectedLayer(const FullyConnectedDescriptor& param, std::unique_ptr<IWorkload> FullyConnectedLayer::CreateWorkload(const IWorkloadFactory& factory) const { // on this level constant data should not be released.. - BOOST_ASSERT_MSG(m_Weight != nullptr, "FullyConnectedLayer: Weights data should not be null."); + ARMNN_ASSERT_MSG(m_Weight != nullptr, "FullyConnectedLayer: Weights data should not be null."); FullyConnectedQueueDescriptor descriptor; descriptor.m_Weight = m_Weight.get(); if (m_Param.m_BiasEnabled) { - BOOST_ASSERT_MSG(m_Bias != nullptr, "FullyConnectedLayer: Bias data should not be null."); + ARMNN_ASSERT_MSG(m_Bias != nullptr, "FullyConnectedLayer: Bias data should not be null."); descriptor.m_Bias = m_Bias.get(); } return factory.CreateFullyConnected(descriptor, PrepInfoAndDesc(descriptor)); @@ -50,7 +50,7 @@ FullyConnectedLayer* FullyConnectedLayer::Clone(Graph& graph) const std::vector<TensorShape> FullyConnectedLayer::InferOutputShapes(const std::vector<TensorShape>& inputShapes) const { - BOOST_ASSERT(inputShapes.size() == 2); + ARMNN_ASSERT(inputShapes.size() == 2); const TensorShape& inputShape = inputShapes[0]; const TensorShape weightShape = inputShapes[1]; @@ -66,13 +66,13 @@ void FullyConnectedLayer::ValidateTensorShapesFromInputs() VerifyLayerConnections(1, CHECK_LOCATION()); // check if we m_Weight data is not nullptr - BOOST_ASSERT_MSG(m_Weight != nullptr, "FullyConnectedLayer: Weights data should not be null."); + ARMNN_ASSERT_MSG(m_Weight != nullptr, "FullyConnectedLayer: Weights data should not be null."); auto inferredShapes = InferOutputShapes({ GetInputSlot(0).GetConnection()->GetTensorInfo().GetShape(), m_Weight->GetTensorInfo().GetShape() }); - BOOST_ASSERT(inferredShapes.size() == 1); + ARMNN_ASSERT(inferredShapes.size() == 1); ConditionalThrowIfNotEqual<LayerValidationException>( "FullyConnectedLayer: TensorShape set on OutputSlot[0] does not match the inferred shape.", diff --git a/src/armnn/layers/InstanceNormalizationLayer.cpp b/src/armnn/layers/InstanceNormalizationLayer.cpp index 9e0212f226..25b133acda 100644 --- a/src/armnn/layers/InstanceNormalizationLayer.cpp +++ b/src/armnn/layers/InstanceNormalizationLayer.cpp @@ -35,7 +35,7 @@ void InstanceNormalizationLayer::ValidateTensorShapesFromInputs() auto inferredShapes = InferOutputShapes({ GetInputSlot(0).GetConnection()->GetTensorInfo().GetShape() }); - BOOST_ASSERT(inferredShapes.size() == 1); + ARMNN_ASSERT(inferredShapes.size() == 1); ConditionalThrowIfNotEqual<LayerValidationException>( "InstanceNormalizationLayer: TensorShape set on OutputSlot[0] does not match the inferred shape.", diff --git a/src/armnn/layers/L2NormalizationLayer.cpp b/src/armnn/layers/L2NormalizationLayer.cpp index 3d9dc538f5..e6d5f064f3 100644 --- a/src/armnn/layers/L2NormalizationLayer.cpp +++ b/src/armnn/layers/L2NormalizationLayer.cpp @@ -35,7 +35,7 @@ void L2NormalizationLayer::ValidateTensorShapesFromInputs() auto inferredShapes = InferOutputShapes({ GetInputSlot(0).GetConnection()->GetTensorInfo().GetShape() }); - BOOST_ASSERT(inferredShapes.size() == 1); + ARMNN_ASSERT(inferredShapes.size() == 1); ConditionalThrowIfNotEqual<LayerValidationException>( "L2NormalizationLayer: TensorShape set on OutputSlot[0] does not match the inferred shape.", diff --git a/src/armnn/layers/LogSoftmaxLayer.cpp b/src/armnn/layers/LogSoftmaxLayer.cpp index 24b6fde339..627aa4cdd3 100644 --- a/src/armnn/layers/LogSoftmaxLayer.cpp +++ b/src/armnn/layers/LogSoftmaxLayer.cpp @@ -34,7 +34,7 @@ void LogSoftmaxLayer::ValidateTensorShapesFromInputs() VerifyLayerConnections(1, CHECK_LOCATION()); auto inferredShapes = InferOutputShapes({ GetInputSlot(0).GetConnection()->GetTensorInfo().GetShape() }); - BOOST_ASSERT(inferredShapes.size() == 1); + ARMNN_ASSERT(inferredShapes.size() == 1); ConditionalThrowIfNotEqual<LayerValidationException>( "LogSoftmaxLayer: TensorShape set on OutputSlot[0] does not match the inferred shape.", diff --git a/src/armnn/layers/LstmLayer.cpp b/src/armnn/layers/LstmLayer.cpp index 1d945690d5..653b18a1c9 100644 --- a/src/armnn/layers/LstmLayer.cpp +++ b/src/armnn/layers/LstmLayer.cpp @@ -147,7 +147,7 @@ LstmLayer* LstmLayer::Clone(Graph& graph) const std::vector<TensorShape> LstmLayer::InferOutputShapes(const std::vector<TensorShape>& inputShapes) const { - BOOST_ASSERT(inputShapes.size() == 3); + ARMNN_ASSERT(inputShapes.size() == 3); // Get input values for validation unsigned int batchSize = inputShapes[0][0]; @@ -173,35 +173,35 @@ void LstmLayer::ValidateTensorShapesFromInputs() GetInputSlot(2).GetConnection()->GetTensorInfo().GetShape()} ); - BOOST_ASSERT(inferredShapes.size() == 4); + ARMNN_ASSERT(inferredShapes.size() == 4); // Check if the weights are nullptr - BOOST_ASSERT_MSG(m_BasicParameters.m_InputToForgetWeights != nullptr, + ARMNN_ASSERT_MSG(m_BasicParameters.m_InputToForgetWeights != nullptr, "LstmLayer: m_BasicParameters.m_InputToForgetWeights should not be null."); - BOOST_ASSERT_MSG(m_BasicParameters.m_InputToCellWeights != nullptr, + ARMNN_ASSERT_MSG(m_BasicParameters.m_InputToCellWeights != nullptr, "LstmLayer: m_BasicParameters.m_InputToCellWeights should not be null."); - BOOST_ASSERT_MSG(m_BasicParameters.m_InputToOutputWeights != nullptr, + ARMNN_ASSERT_MSG(m_BasicParameters.m_InputToOutputWeights != nullptr, "LstmLayer: m_BasicParameters.m_InputToOutputWeights should not be null."); - BOOST_ASSERT_MSG(m_BasicParameters.m_RecurrentToForgetWeights != nullptr, + ARMNN_ASSERT_MSG(m_BasicParameters.m_RecurrentToForgetWeights != nullptr, "LstmLayer: m_BasicParameters.m_RecurrentToForgetWeights should not be null."); - BOOST_ASSERT_MSG(m_BasicParameters.m_RecurrentToCellWeights != nullptr, + ARMNN_ASSERT_MSG(m_BasicParameters.m_RecurrentToCellWeights != nullptr, "LstmLayer: m_BasicParameters.m_RecurrentToCellWeights should not be null."); - BOOST_ASSERT_MSG(m_BasicParameters.m_RecurrentToOutputWeights != nullptr, + ARMNN_ASSERT_MSG(m_BasicParameters.m_RecurrentToOutputWeights != nullptr, "LstmLayer: m_BasicParameters.m_RecurrentToOutputWeights should not be null."); - BOOST_ASSERT_MSG(m_BasicParameters.m_ForgetGateBias != nullptr, + ARMNN_ASSERT_MSG(m_BasicParameters.m_ForgetGateBias != nullptr, "LstmLayer: m_BasicParameters.m_ForgetGateBias should not be null."); - BOOST_ASSERT_MSG(m_BasicParameters.m_CellBias != nullptr, + ARMNN_ASSERT_MSG(m_BasicParameters.m_CellBias != nullptr, "LstmLayer: m_BasicParameters.m_CellBias should not be null."); - BOOST_ASSERT_MSG(m_BasicParameters.m_OutputGateBias != nullptr, + ARMNN_ASSERT_MSG(m_BasicParameters.m_OutputGateBias != nullptr, "LstmLayer: m_BasicParameters.m_OutputGateBias should not be null."); if (!m_Param.m_CifgEnabled) { - BOOST_ASSERT_MSG(m_CifgParameters.m_InputToInputWeights != nullptr, + ARMNN_ASSERT_MSG(m_CifgParameters.m_InputToInputWeights != nullptr, "LstmLayer: m_CifgParameters.m_InputToInputWeights should not be null."); - BOOST_ASSERT_MSG(m_CifgParameters.m_RecurrentToInputWeights != nullptr, + ARMNN_ASSERT_MSG(m_CifgParameters.m_RecurrentToInputWeights != nullptr, "LstmLayer: m_CifgParameters.m_RecurrentToInputWeights should not be null."); - BOOST_ASSERT_MSG(m_CifgParameters.m_InputGateBias != nullptr, + ARMNN_ASSERT_MSG(m_CifgParameters.m_InputGateBias != nullptr, "LstmLayer: m_CifgParameters.m_InputGateBias should not be null."); ConditionalThrowIfNotEqual<LayerValidationException>( @@ -211,11 +211,11 @@ void LstmLayer::ValidateTensorShapesFromInputs() } else { - BOOST_ASSERT_MSG(m_CifgParameters.m_InputToInputWeights == nullptr, + ARMNN_ASSERT_MSG(m_CifgParameters.m_InputToInputWeights == nullptr, "LstmLayer: m_CifgParameters.m_InputToInputWeights should not have a value when CIFG is enabled."); - BOOST_ASSERT_MSG(m_CifgParameters.m_RecurrentToInputWeights == nullptr, + ARMNN_ASSERT_MSG(m_CifgParameters.m_RecurrentToInputWeights == nullptr, "LstmLayer: m_CifgParameters.m_RecurrentToInputWeights should not have a value when CIFG is enabled."); - BOOST_ASSERT_MSG(m_CifgParameters.m_InputGateBias == nullptr, + ARMNN_ASSERT_MSG(m_CifgParameters.m_InputGateBias == nullptr, "LstmLayer: m_CifgParameters.m_InputGateBias should not have a value when CIFG is enabled."); ConditionalThrowIfNotEqual<LayerValidationException>( @@ -226,7 +226,7 @@ void LstmLayer::ValidateTensorShapesFromInputs() if (m_Param.m_ProjectionEnabled) { - BOOST_ASSERT_MSG(m_ProjectionParameters.m_ProjectionWeights != nullptr, + ARMNN_ASSERT_MSG(m_ProjectionParameters.m_ProjectionWeights != nullptr, "LstmLayer: m_ProjectionParameters.m_ProjectionWeights should not be null."); } @@ -234,13 +234,13 @@ void LstmLayer::ValidateTensorShapesFromInputs() { if (!m_Param.m_CifgEnabled) { - BOOST_ASSERT_MSG(m_PeepholeParameters.m_CellToInputWeights != nullptr, + ARMNN_ASSERT_MSG(m_PeepholeParameters.m_CellToInputWeights != nullptr, "LstmLayer: m_PeepholeParameters.m_CellToInputWeights should not be null " "when Peephole is enabled and CIFG is disabled."); } - BOOST_ASSERT_MSG(m_PeepholeParameters.m_CellToForgetWeights != nullptr, + ARMNN_ASSERT_MSG(m_PeepholeParameters.m_CellToForgetWeights != nullptr, "LstmLayer: m_PeepholeParameters.m_CellToForgetWeights should not be null."); - BOOST_ASSERT_MSG(m_PeepholeParameters.m_CellToOutputWeights != nullptr, + ARMNN_ASSERT_MSG(m_PeepholeParameters.m_CellToOutputWeights != nullptr, "LstmLayer: m_PeepholeParameters.m_CellToOutputWeights should not be null."); } @@ -261,14 +261,14 @@ void LstmLayer::ValidateTensorShapesFromInputs() { if(!m_Param.m_CifgEnabled) { - BOOST_ASSERT_MSG(m_LayerNormParameters.m_InputLayerNormWeights != nullptr, + ARMNN_ASSERT_MSG(m_LayerNormParameters.m_InputLayerNormWeights != nullptr, "LstmLayer: m_LayerNormParameters.m_inputLayerNormWeights should not be null."); } - BOOST_ASSERT_MSG(m_LayerNormParameters.m_ForgetLayerNormWeights != nullptr, + ARMNN_ASSERT_MSG(m_LayerNormParameters.m_ForgetLayerNormWeights != nullptr, "LstmLayer: m_LayerNormParameters.m_forgetLayerNormWeights should not be null."); - BOOST_ASSERT_MSG(m_LayerNormParameters.m_CellLayerNormWeights != nullptr, + ARMNN_ASSERT_MSG(m_LayerNormParameters.m_CellLayerNormWeights != nullptr, "LstmLayer: m_LayerNormParameters.m_cellLayerNormWeights should not be null."); - BOOST_ASSERT_MSG(m_LayerNormParameters.m_OutputLayerNormWeights != nullptr, + ARMNN_ASSERT_MSG(m_LayerNormParameters.m_OutputLayerNormWeights != nullptr, "LstmLayer: m_LayerNormParameters.m_outputLayerNormWeights should not be null."); } } diff --git a/src/armnn/layers/MeanLayer.cpp b/src/armnn/layers/MeanLayer.cpp index 30b88fa1b9..5fa88f9398 100644 --- a/src/armnn/layers/MeanLayer.cpp +++ b/src/armnn/layers/MeanLayer.cpp @@ -44,7 +44,7 @@ void MeanLayer::ValidateTensorShapesFromInputs() const TensorInfo& input = GetInputSlot(0).GetConnection()->GetTensorInfo(); - BOOST_ASSERT_MSG(input.GetNumDimensions() > 0 && input.GetNumDimensions() <= 4, + ARMNN_ASSERT_MSG(input.GetNumDimensions() > 0 && input.GetNumDimensions() <= 4, "MeanLayer: Mean supports up to 4D input."); unsigned int rank = input.GetNumDimensions(); diff --git a/src/armnn/layers/MemCopyLayer.cpp b/src/armnn/layers/MemCopyLayer.cpp index cf69c17cf5..e4009de022 100644 --- a/src/armnn/layers/MemCopyLayer.cpp +++ b/src/armnn/layers/MemCopyLayer.cpp @@ -39,7 +39,7 @@ void MemCopyLayer::ValidateTensorShapesFromInputs() auto inferredShapes = InferOutputShapes({ GetInputSlot(0).GetConnection()->GetTensorInfo().GetShape() }); - BOOST_ASSERT(inferredShapes.size() == 1); + ARMNN_ASSERT(inferredShapes.size() == 1); ConditionalThrowIfNotEqual<LayerValidationException>( "MemCopyLayer: TensorShape set on OutputSlot[0] does not match the inferred shape.", diff --git a/src/armnn/layers/MemImportLayer.cpp b/src/armnn/layers/MemImportLayer.cpp index 80f9fda803..bcccba1f4a 100644 --- a/src/armnn/layers/MemImportLayer.cpp +++ b/src/armnn/layers/MemImportLayer.cpp @@ -39,7 +39,7 @@ void MemImportLayer::ValidateTensorShapesFromInputs() auto inferredShapes = InferOutputShapes({ GetInputSlot(0).GetConnection()->GetTensorInfo().GetShape() }); - BOOST_ASSERT(inferredShapes.size() == 1); + ARMNN_ASSERT(inferredShapes.size() == 1); ConditionalThrowIfNotEqual<LayerValidationException>( "MemImportLayer: TensorShape set on OutputSlot[0] does not match the inferred shape.", diff --git a/src/armnn/layers/MergeLayer.cpp b/src/armnn/layers/MergeLayer.cpp index f2fd29fe9e..ad7d8b1416 100644 --- a/src/armnn/layers/MergeLayer.cpp +++ b/src/armnn/layers/MergeLayer.cpp @@ -36,7 +36,7 @@ void MergeLayer::ValidateTensorShapesFromInputs() GetInputSlot(1).GetConnection()->GetTensorInfo().GetShape(), }); - BOOST_ASSERT(inferredShapes.size() == 1); + ARMNN_ASSERT(inferredShapes.size() == 1); ConditionalThrowIfNotEqual<LayerValidationException>( "MergeLayer: TensorShape set on OutputSlot[0] does not match the inferred shape.", @@ -46,7 +46,7 @@ void MergeLayer::ValidateTensorShapesFromInputs() std::vector<TensorShape> MergeLayer::InferOutputShapes(const std::vector<TensorShape>& inputShapes) const { - BOOST_ASSERT(inputShapes.size() == 2); + ARMNN_ASSERT(inputShapes.size() == 2); ConditionalThrowIfNotEqual<LayerValidationException>( "MergeLayer: TensorShapes set on inputs do not match", diff --git a/src/armnn/layers/NormalizationLayer.cpp b/src/armnn/layers/NormalizationLayer.cpp index 09f8a0d00e..44179fd534 100644 --- a/src/armnn/layers/NormalizationLayer.cpp +++ b/src/armnn/layers/NormalizationLayer.cpp @@ -35,7 +35,7 @@ void NormalizationLayer::ValidateTensorShapesFromInputs() auto inferredShapes = InferOutputShapes({ GetInputSlot(0).GetConnection()->GetTensorInfo().GetShape() }); - BOOST_ASSERT(inferredShapes.size() == 1); + ARMNN_ASSERT(inferredShapes.size() == 1); ConditionalThrowIfNotEqual<LayerValidationException>( "NormalizationLayer: TensorShape set on OutputSlot[0] does not match the inferred shape.", diff --git a/src/armnn/layers/PermuteLayer.cpp b/src/armnn/layers/PermuteLayer.cpp index 0fc3ce4bf6..e565b48b57 100644 --- a/src/armnn/layers/PermuteLayer.cpp +++ b/src/armnn/layers/PermuteLayer.cpp @@ -35,7 +35,7 @@ PermuteLayer* PermuteLayer::Clone(Graph& graph) const std::vector<TensorShape> PermuteLayer::InferOutputShapes(const std::vector<TensorShape>& inputShapes) const { - BOOST_ASSERT(inputShapes.size() == 1); + ARMNN_ASSERT(inputShapes.size() == 1); const TensorShape& inShape = inputShapes[0]; return std::vector<TensorShape> ({armnnUtils::Permuted(inShape, m_Param.m_DimMappings)}); } @@ -46,7 +46,7 @@ void PermuteLayer::ValidateTensorShapesFromInputs() auto inferredShapes = InferOutputShapes({ GetInputSlot(0).GetConnection()->GetTensorInfo().GetShape() }); - BOOST_ASSERT(inferredShapes.size() == 1); + ARMNN_ASSERT(inferredShapes.size() == 1); ConditionalThrowIfNotEqual<LayerValidationException>( "PermuteLayer: TensorShape set on OutputSlot[0] does not match the inferred shape.", diff --git a/src/armnn/layers/Pooling2dLayer.cpp b/src/armnn/layers/Pooling2dLayer.cpp index a3c2425097..ad2c82f761 100644 --- a/src/armnn/layers/Pooling2dLayer.cpp +++ b/src/armnn/layers/Pooling2dLayer.cpp @@ -37,12 +37,12 @@ Pooling2dLayer* Pooling2dLayer::Clone(Graph& graph) const std::vector<TensorShape> Pooling2dLayer::InferOutputShapes(const std::vector<TensorShape>& inputShapes) const { - BOOST_ASSERT(inputShapes.size() == 1); + ARMNN_ASSERT(inputShapes.size() == 1); const TensorShape& inputShape = inputShapes[0]; const DataLayoutIndexed dimensionIndices = m_Param.m_DataLayout; // If we support multiple batch dimensions in the future, then this assert will need to change. - BOOST_ASSERT_MSG(inputShape.GetNumDimensions() == 4, "Pooling2dLayer will always have 4D input."); + ARMNN_ASSERT_MSG(inputShape.GetNumDimensions() == 4, "Pooling2dLayer will always have 4D input."); unsigned int inWidth = inputShape[dimensionIndices.GetWidthIndex()]; unsigned int inHeight = inputShape[dimensionIndices.GetHeightIndex()]; @@ -54,7 +54,7 @@ std::vector<TensorShape> Pooling2dLayer::InferOutputShapes(const std::vector<Ten unsigned int outHeight = 1; if (!isGlobalPooling) { - BOOST_ASSERT_MSG(m_Param.m_StrideX!=0 && m_Param.m_StrideY!=0, + ARMNN_ASSERT_MSG(m_Param.m_StrideX!=0 && m_Param.m_StrideY!=0, "Stride can only be zero when performing global pooling"); auto CalcSize = [](auto inSize, auto lowPad, auto highPad, auto poolSize, auto stride, auto outputShapeRounding) @@ -72,7 +72,7 @@ std::vector<TensorShape> Pooling2dLayer::InferOutputShapes(const std::vector<Ten size = static_cast<unsigned int>(floor(div)) + 1; break; default: - BOOST_ASSERT_MSG(false, "Unsupported Output Shape Rounding"); + ARMNN_ASSERT_MSG(false, "Unsupported Output Shape Rounding"); } // MakeS sure that border operations will start from inside the input and not the padded area. @@ -106,7 +106,7 @@ void Pooling2dLayer::ValidateTensorShapesFromInputs() auto inferredShapes = InferOutputShapes({ GetInputSlot(0).GetConnection()->GetTensorInfo().GetShape() }); - BOOST_ASSERT(inferredShapes.size() == 1); + ARMNN_ASSERT(inferredShapes.size() == 1); ConditionalThrowIfNotEqual<LayerValidationException>( "Pooling2dLayer: TensorShape set on OutputSlot[0] does not match the inferred shape.", diff --git a/src/armnn/layers/PreluLayer.cpp b/src/armnn/layers/PreluLayer.cpp index d9e59224a0..609480673b 100644 --- a/src/armnn/layers/PreluLayer.cpp +++ b/src/armnn/layers/PreluLayer.cpp @@ -34,7 +34,7 @@ PreluLayer* PreluLayer::Clone(Graph& graph) const std::vector<TensorShape> PreluLayer::InferOutputShapes(const std::vector<TensorShape>& inputShapes) const { - BOOST_ASSERT(inputShapes.size() == 2); + ARMNN_ASSERT(inputShapes.size() == 2); const TensorShape& inputShape = inputShapes[0]; const TensorShape& alphaShape = inputShapes[1]; @@ -42,8 +42,8 @@ std::vector<TensorShape> PreluLayer::InferOutputShapes(const std::vector<TensorS const unsigned int inputShapeDimensions = inputShape.GetNumDimensions(); const unsigned int alphaShapeDimensions = alphaShape.GetNumDimensions(); - BOOST_ASSERT(inputShapeDimensions > 0); - BOOST_ASSERT(alphaShapeDimensions > 0); + ARMNN_ASSERT(inputShapeDimensions > 0); + ARMNN_ASSERT(alphaShapeDimensions > 0); // The size of the output is the maximum size along each dimension of the input operands, // it starts with the trailing dimensions, and works its way forward @@ -63,7 +63,7 @@ std::vector<TensorShape> PreluLayer::InferOutputShapes(const std::vector<TensorS unsigned int alphaDimension = alphaShape[boost::numeric_cast<unsigned int>(alphaShapeIndex)]; // Check that the inputs are broadcast compatible - BOOST_ASSERT_MSG(inputDimension == alphaDimension || inputDimension == 1 || alphaDimension == 1, + ARMNN_ASSERT_MSG(inputDimension == alphaDimension || inputDimension == 1 || alphaDimension == 1, "PreluLayer: Dimensions should either match or one should be of size 1"); outputShape[outputShapeIndex] = std::max(inputDimension, alphaDimension); @@ -104,7 +104,7 @@ void PreluLayer::ValidateTensorShapesFromInputs() GetInputSlot(1).GetConnection()->GetTensorInfo().GetShape() }); - BOOST_ASSERT(inferredShapes.size() == 1); + ARMNN_ASSERT(inferredShapes.size() == 1); ConditionalThrowIfNotEqual<LayerValidationException>( "PreluLayer: TensorShape set on OutputSlot[0] does not match the inferred shape.", diff --git a/src/armnn/layers/QLstmLayer.cpp b/src/armnn/layers/QLstmLayer.cpp index 393a7029aa..9b940c1823 100644 --- a/src/armnn/layers/QLstmLayer.cpp +++ b/src/armnn/layers/QLstmLayer.cpp @@ -150,7 +150,7 @@ QLstmLayer* QLstmLayer::Clone(Graph& graph) const std::vector<TensorShape> QLstmLayer::InferOutputShapes(const std::vector<TensorShape>& inputShapes) const { - BOOST_ASSERT(inputShapes.size() == 3); + ARMNN_ASSERT(inputShapes.size() == 3); // Get input values for validation unsigned int batchSize = inputShapes[0][0]; @@ -176,35 +176,35 @@ void QLstmLayer::ValidateTensorShapesFromInputs() GetInputSlot(2).GetConnection()->GetTensorInfo().GetShape() // previousCellStateIn }); - BOOST_ASSERT(inferredShapes.size() == 3); + ARMNN_ASSERT(inferredShapes.size() == 3); // Check if the weights are nullptr for basic params - BOOST_ASSERT_MSG(m_BasicParameters.m_InputToForgetWeights != nullptr, + ARMNN_ASSERT_MSG(m_BasicParameters.m_InputToForgetWeights != nullptr, "QLstmLayer: m_BasicParameters.m_InputToForgetWeights should not be null."); - BOOST_ASSERT_MSG(m_BasicParameters.m_InputToCellWeights != nullptr, + ARMNN_ASSERT_MSG(m_BasicParameters.m_InputToCellWeights != nullptr, "QLstmLayer: m_BasicParameters.m_InputToCellWeights should not be null."); - BOOST_ASSERT_MSG(m_BasicParameters.m_InputToOutputWeights != nullptr, + ARMNN_ASSERT_MSG(m_BasicParameters.m_InputToOutputWeights != nullptr, "QLstmLayer: m_BasicParameters.m_InputToOutputWeights should not be null."); - BOOST_ASSERT_MSG(m_BasicParameters.m_RecurrentToForgetWeights != nullptr, + ARMNN_ASSERT_MSG(m_BasicParameters.m_RecurrentToForgetWeights != nullptr, "QLstmLayer: m_BasicParameters.m_RecurrentToForgetWeights should not be null."); - BOOST_ASSERT_MSG(m_BasicParameters.m_RecurrentToCellWeights != nullptr, + ARMNN_ASSERT_MSG(m_BasicParameters.m_RecurrentToCellWeights != nullptr, "QLstmLayer: m_BasicParameters.m_RecurrentToCellWeights should not be null."); - BOOST_ASSERT_MSG(m_BasicParameters.m_RecurrentToOutputWeights != nullptr, + ARMNN_ASSERT_MSG(m_BasicParameters.m_RecurrentToOutputWeights != nullptr, "QLstmLayer: m_BasicParameters.m_RecurrentToOutputWeights should not be null."); - BOOST_ASSERT_MSG(m_BasicParameters.m_ForgetGateBias != nullptr, + ARMNN_ASSERT_MSG(m_BasicParameters.m_ForgetGateBias != nullptr, "QLstmLayer: m_BasicParameters.m_ForgetGateBias should not be null."); - BOOST_ASSERT_MSG(m_BasicParameters.m_CellBias != nullptr, + ARMNN_ASSERT_MSG(m_BasicParameters.m_CellBias != nullptr, "QLstmLayer: m_BasicParameters.m_CellBias should not be null."); - BOOST_ASSERT_MSG(m_BasicParameters.m_OutputGateBias != nullptr, + ARMNN_ASSERT_MSG(m_BasicParameters.m_OutputGateBias != nullptr, "QLstmLayer: m_BasicParameters.m_OutputGateBias should not be null."); if (!m_Param.m_CifgEnabled) { - BOOST_ASSERT_MSG(m_CifgParameters.m_InputToInputWeights != nullptr, + ARMNN_ASSERT_MSG(m_CifgParameters.m_InputToInputWeights != nullptr, "QLstmLayer: m_CifgParameters.m_InputToInputWeights should not be null."); - BOOST_ASSERT_MSG(m_CifgParameters.m_RecurrentToInputWeights != nullptr, + ARMNN_ASSERT_MSG(m_CifgParameters.m_RecurrentToInputWeights != nullptr, "QLstmLayer: m_CifgParameters.m_RecurrentToInputWeights should not be null."); - BOOST_ASSERT_MSG(m_CifgParameters.m_InputGateBias != nullptr, + ARMNN_ASSERT_MSG(m_CifgParameters.m_InputGateBias != nullptr, "QLstmLayer: m_CifgParameters.m_InputGateBias should not be null."); ConditionalThrowIfNotEqual<LayerValidationException>( @@ -214,12 +214,12 @@ void QLstmLayer::ValidateTensorShapesFromInputs() } else { - BOOST_ASSERT_MSG(m_CifgParameters.m_InputToInputWeights == nullptr, + ARMNN_ASSERT_MSG(m_CifgParameters.m_InputToInputWeights == nullptr, "QLstmLayer: m_CifgParameters.m_InputToInputWeights should not have a value when CIFG is enabled."); - BOOST_ASSERT_MSG(m_CifgParameters.m_RecurrentToInputWeights == nullptr, + ARMNN_ASSERT_MSG(m_CifgParameters.m_RecurrentToInputWeights == nullptr, "QLstmLayer: m_CifgParameters.m_RecurrentToInputWeights should " "not have a value when CIFG is enabled."); - BOOST_ASSERT_MSG(m_CifgParameters.m_InputGateBias == nullptr, + ARMNN_ASSERT_MSG(m_CifgParameters.m_InputGateBias == nullptr, "QLstmLayer: m_CifgParameters.m_InputGateBias should not have a value when CIFG is enabled."); ConditionalThrowIfNotEqual<LayerValidationException>( @@ -230,23 +230,23 @@ void QLstmLayer::ValidateTensorShapesFromInputs() if (m_Param.m_ProjectionEnabled) { - BOOST_ASSERT_MSG(m_ProjectionParameters.m_ProjectionWeights != nullptr, + ARMNN_ASSERT_MSG(m_ProjectionParameters.m_ProjectionWeights != nullptr, "QLstmLayer: m_ProjectionParameters.m_ProjectionWeights should not be null."); - BOOST_ASSERT_MSG(m_ProjectionParameters.m_ProjectionBias != nullptr, + ARMNN_ASSERT_MSG(m_ProjectionParameters.m_ProjectionBias != nullptr, "QLstmLayer: m_ProjectionParameters.m_ProjectionBias should not be null."); } if (m_Param.m_PeepholeEnabled) { if (!m_Param.m_CifgEnabled) { - BOOST_ASSERT_MSG(m_PeepholeParameters.m_CellToInputWeights != nullptr, + ARMNN_ASSERT_MSG(m_PeepholeParameters.m_CellToInputWeights != nullptr, "QLstmLayer: m_PeepholeParameters.m_CellToInputWeights should not be null " "when Peephole is enabled and CIFG is disabled."); } - BOOST_ASSERT_MSG(m_PeepholeParameters.m_CellToForgetWeights != nullptr, + ARMNN_ASSERT_MSG(m_PeepholeParameters.m_CellToForgetWeights != nullptr, "QLstmLayer: m_PeepholeParameters.m_CellToForgetWeights should not be null."); - BOOST_ASSERT_MSG(m_PeepholeParameters.m_CellToOutputWeights != nullptr, + ARMNN_ASSERT_MSG(m_PeepholeParameters.m_CellToOutputWeights != nullptr, "QLstmLayer: m_PeepholeParameters.m_CellToOutputWeights should not be null."); } @@ -263,14 +263,14 @@ void QLstmLayer::ValidateTensorShapesFromInputs() { if(!m_Param.m_CifgEnabled) { - BOOST_ASSERT_MSG(m_LayerNormParameters.m_InputLayerNormWeights != nullptr, + ARMNN_ASSERT_MSG(m_LayerNormParameters.m_InputLayerNormWeights != nullptr, "QLstmLayer: m_LayerNormParameters.m_InputLayerNormWeights should not be null."); } - BOOST_ASSERT_MSG(m_LayerNormParameters.m_ForgetLayerNormWeights != nullptr, + ARMNN_ASSERT_MSG(m_LayerNormParameters.m_ForgetLayerNormWeights != nullptr, "QLstmLayer: m_LayerNormParameters.m_ForgetLayerNormWeights should not be null."); - BOOST_ASSERT_MSG(m_LayerNormParameters.m_CellLayerNormWeights != nullptr, + ARMNN_ASSERT_MSG(m_LayerNormParameters.m_CellLayerNormWeights != nullptr, "QLstmLayer: m_LayerNormParameters.m_CellLayerNormWeights should not be null."); - BOOST_ASSERT_MSG(m_LayerNormParameters.m_OutputLayerNormWeights != nullptr, + ARMNN_ASSERT_MSG(m_LayerNormParameters.m_OutputLayerNormWeights != nullptr, "QLstmLayer: m_LayerNormParameters.m_UutputLayerNormWeights should not be null."); } } diff --git a/src/armnn/layers/QuantizedLstmLayer.cpp b/src/armnn/layers/QuantizedLstmLayer.cpp index 8717041a53..b56ae3ff52 100644 --- a/src/armnn/layers/QuantizedLstmLayer.cpp +++ b/src/armnn/layers/QuantizedLstmLayer.cpp @@ -78,7 +78,7 @@ QuantizedLstmLayer* QuantizedLstmLayer::Clone(Graph& graph) const std::vector<TensorShape> QuantizedLstmLayer::InferOutputShapes(const std::vector<TensorShape>& inputShapes) const { - BOOST_ASSERT(inputShapes.size() == 3); + ARMNN_ASSERT(inputShapes.size() == 3); // Get input values for validation unsigned int numBatches = inputShapes[0][0]; @@ -102,34 +102,34 @@ void QuantizedLstmLayer::ValidateTensorShapesFromInputs() GetInputSlot(2).GetConnection()->GetTensorInfo().GetShape() // previousOutputIn }); - BOOST_ASSERT(inferredShapes.size() == 2); + ARMNN_ASSERT(inferredShapes.size() == 2); // Check weights and bias for nullptr - BOOST_ASSERT_MSG(m_QuantizedLstmParameters.m_InputToInputWeights != nullptr, + ARMNN_ASSERT_MSG(m_QuantizedLstmParameters.m_InputToInputWeights != nullptr, "QuantizedLstmLayer: m_QuantizedLstmParameters.m_InputToInputWeights should not be null."); - BOOST_ASSERT_MSG(m_QuantizedLstmParameters.m_InputToForgetWeights != nullptr, + ARMNN_ASSERT_MSG(m_QuantizedLstmParameters.m_InputToForgetWeights != nullptr, "QuantizedLstmLayer: m_QuantizedLstmParameters.m_InputToForgetWeights should not be null."); - BOOST_ASSERT_MSG(m_QuantizedLstmParameters.m_InputToCellWeights != nullptr, + ARMNN_ASSERT_MSG(m_QuantizedLstmParameters.m_InputToCellWeights != nullptr, "QuantizedLstmLayer: m_QuantizedLstmParameters.m_InputToCellWeights should not be null."); - BOOST_ASSERT_MSG(m_QuantizedLstmParameters.m_InputToOutputWeights != nullptr, + ARMNN_ASSERT_MSG(m_QuantizedLstmParameters.m_InputToOutputWeights != nullptr, "QuantizedLstmLayer: m_QuantizedLstmParameters.m_InputToOutputWeights should not be null."); - BOOST_ASSERT_MSG(m_QuantizedLstmParameters.m_RecurrentToInputWeights != nullptr, + ARMNN_ASSERT_MSG(m_QuantizedLstmParameters.m_RecurrentToInputWeights != nullptr, "QuantizedLstmLayer: m_QuantizedLstmParameters.m_RecurrentToInputWeights should not be null."); - BOOST_ASSERT_MSG(m_QuantizedLstmParameters.m_RecurrentToForgetWeights != nullptr, + ARMNN_ASSERT_MSG(m_QuantizedLstmParameters.m_RecurrentToForgetWeights != nullptr, "QuantizedLstmLayer: m_QuantizedLstmParameters.m_RecurrentToForgetWeights should not be null."); - BOOST_ASSERT_MSG(m_QuantizedLstmParameters.m_RecurrentToCellWeights != nullptr, + ARMNN_ASSERT_MSG(m_QuantizedLstmParameters.m_RecurrentToCellWeights != nullptr, "QuantizedLstmLayer: m_QuantizedLstmParameters.m_RecurrentToCellWeights should not be null."); - BOOST_ASSERT_MSG(m_QuantizedLstmParameters.m_RecurrentToOutputWeights != nullptr, + ARMNN_ASSERT_MSG(m_QuantizedLstmParameters.m_RecurrentToOutputWeights != nullptr, "QuantizedLstmLayer: m_QuantizedLstmParameters.m_RecurrentToOutputWeights should not be null."); - BOOST_ASSERT_MSG(m_QuantizedLstmParameters.m_InputGateBias != nullptr, + ARMNN_ASSERT_MSG(m_QuantizedLstmParameters.m_InputGateBias != nullptr, "QuantizedLstmLayer: m_QuantizedLstmParameters.m_InputGateBias should not be null."); - BOOST_ASSERT_MSG(m_QuantizedLstmParameters.m_ForgetGateBias != nullptr, + ARMNN_ASSERT_MSG(m_QuantizedLstmParameters.m_ForgetGateBias != nullptr, "QuantizedLstmLayer: m_QuantizedLstmParameters.m_ForgetGateBias should not be null."); - BOOST_ASSERT_MSG(m_QuantizedLstmParameters.m_CellBias != nullptr, + ARMNN_ASSERT_MSG(m_QuantizedLstmParameters.m_CellBias != nullptr, "QuantizedLstmLayer: m_QuantizedLstmParameters.m_CellBias should not be null."); - BOOST_ASSERT_MSG(m_QuantizedLstmParameters.m_OutputGateBias != nullptr, + ARMNN_ASSERT_MSG(m_QuantizedLstmParameters.m_OutputGateBias != nullptr, "QuantizedLstmLayer: m_QuantizedLstmParameters.m_OutputGateBias should not be null."); // Check output TensorShape(s) match inferred shape diff --git a/src/armnn/layers/ReshapeLayer.cpp b/src/armnn/layers/ReshapeLayer.cpp index fbf3eaa80a..b496dbb642 100644 --- a/src/armnn/layers/ReshapeLayer.cpp +++ b/src/armnn/layers/ReshapeLayer.cpp @@ -42,7 +42,7 @@ void ReshapeLayer::ValidateTensorShapesFromInputs() auto inferredShapes = InferOutputShapes({ }); - BOOST_ASSERT(inferredShapes.size() == 1); + ARMNN_ASSERT(inferredShapes.size() == 1); ConditionalThrowIfNotEqual<LayerValidationException>( "ReshapeLayer: TensorShape set on OutputSlot[0] does not match the inferred shape.", diff --git a/src/armnn/layers/ResizeLayer.cpp b/src/armnn/layers/ResizeLayer.cpp index e341191de1..9654e58b43 100644 --- a/src/armnn/layers/ResizeLayer.cpp +++ b/src/armnn/layers/ResizeLayer.cpp @@ -36,7 +36,7 @@ ResizeLayer* ResizeLayer::Clone(Graph& graph) const std::vector<TensorShape> ResizeLayer::InferOutputShapes(const std::vector<TensorShape>& inputShapes) const { - BOOST_ASSERT(inputShapes.size() == 1); + ARMNN_ASSERT(inputShapes.size() == 1); const TensorShape& inputShape = inputShapes[0]; const DataLayoutIndexed dimensionIndices = m_Param.m_DataLayout; @@ -59,7 +59,7 @@ void ResizeLayer::ValidateTensorShapesFromInputs() auto inferredShapes = InferOutputShapes({ GetInputSlot(0).GetConnection()->GetTensorInfo().GetShape() }); - BOOST_ASSERT(inferredShapes.size() == 1); + ARMNN_ASSERT(inferredShapes.size() == 1); ConditionalThrowIfNotEqual<LayerValidationException>( "ResizeLayer: TensorShape set on OutputSlot[0] does not match the inferred shape.", diff --git a/src/armnn/layers/RsqrtLayer.cpp b/src/armnn/layers/RsqrtLayer.cpp index 6ff7372aa7..dfd466dca3 100644 --- a/src/armnn/layers/RsqrtLayer.cpp +++ b/src/armnn/layers/RsqrtLayer.cpp @@ -36,7 +36,7 @@ void RsqrtLayer::ValidateTensorShapesFromInputs() auto inferredShapes = InferOutputShapes({ GetInputSlot(0).GetConnection()->GetTensorInfo().GetShape() }); - BOOST_ASSERT(inferredShapes.size() == 1); + ARMNN_ASSERT(inferredShapes.size() == 1); ConditionalThrowIfNotEqual<LayerValidationException>( "RsqrtLayer: TensorShape set on OutputSlot[0] does not match the inferred shape.", diff --git a/src/armnn/layers/SliceLayer.cpp b/src/armnn/layers/SliceLayer.cpp index ec82082c4a..d92ed6fc48 100644 --- a/src/armnn/layers/SliceLayer.cpp +++ b/src/armnn/layers/SliceLayer.cpp @@ -12,7 +12,6 @@ #include <backendsCommon/WorkloadData.hpp> #include <backendsCommon/WorkloadFactory.hpp> -#include <boost/assert.hpp> #include <boost/numeric/conversion/cast.hpp> namespace armnn @@ -40,7 +39,7 @@ void SliceLayer::ValidateTensorShapesFromInputs() auto inferredShapes = InferOutputShapes({ GetInputSlot(0).GetConnection()->GetTensorInfo().GetShape() }); - BOOST_ASSERT(inferredShapes.size() == 1); + ARMNN_ASSERT(inferredShapes.size() == 1); ConditionalThrowIfNotEqual<LayerValidationException>( "SliceLayer: TensorShape set on OutputSlot[0] does not match the inferred shape.", @@ -51,7 +50,7 @@ void SliceLayer::ValidateTensorShapesFromInputs() std::vector<TensorShape> SliceLayer::InferOutputShapes(const std::vector<TensorShape>& inputShapes) const { IgnoreUnused(inputShapes); - BOOST_ASSERT(inputShapes.size() == 1); + ARMNN_ASSERT(inputShapes.size() == 1); TensorShape outputShape(boost::numeric_cast<unsigned int>(m_Param.m_Size.size()), m_Param.m_Size.data()); diff --git a/src/armnn/layers/SoftmaxLayer.cpp b/src/armnn/layers/SoftmaxLayer.cpp index cb70bbc20d..738347c1b3 100644 --- a/src/armnn/layers/SoftmaxLayer.cpp +++ b/src/armnn/layers/SoftmaxLayer.cpp @@ -35,7 +35,7 @@ void SoftmaxLayer::ValidateTensorShapesFromInputs() auto inferredShapes = InferOutputShapes({ GetInputSlot(0).GetConnection()->GetTensorInfo().GetShape() }); - BOOST_ASSERT(inferredShapes.size() == 1); + ARMNN_ASSERT(inferredShapes.size() == 1); ConditionalThrowIfNotEqual<LayerValidationException>( "SoftmaxLayer: TensorShape set on OutputSlot[0] does not match the inferred shape.", diff --git a/src/armnn/layers/SpaceToBatchNdLayer.cpp b/src/armnn/layers/SpaceToBatchNdLayer.cpp index ec724bafd0..ce48b5b5c2 100644 --- a/src/armnn/layers/SpaceToBatchNdLayer.cpp +++ b/src/armnn/layers/SpaceToBatchNdLayer.cpp @@ -41,7 +41,7 @@ SpaceToBatchNdLayer* SpaceToBatchNdLayer::Clone(Graph& graph) const std::vector<TensorShape> SpaceToBatchNdLayer::InferOutputShapes(const std::vector<TensorShape>& inputShapes) const { - BOOST_ASSERT(inputShapes.size() == 1); + ARMNN_ASSERT(inputShapes.size() == 1); TensorShape inputShape = inputShapes[0]; TensorShape outputShape(inputShape); @@ -73,7 +73,7 @@ void SpaceToBatchNdLayer::ValidateTensorShapesFromInputs() std::vector<TensorShape> inferredShapes = InferOutputShapes({ GetInputSlot(0).GetConnection()->GetTensorInfo().GetShape() }); - BOOST_ASSERT(inferredShapes.size() == 1); + ARMNN_ASSERT(inferredShapes.size() == 1); ConditionalThrowIfNotEqual<LayerValidationException>( "SpaceToBatchNdLayer: TensorShape set on OutputSlot[0] does not match the inferred shape.", diff --git a/src/armnn/layers/SpaceToDepthLayer.cpp b/src/armnn/layers/SpaceToDepthLayer.cpp index 8aa0c9f8cd..bf65240e0c 100644 --- a/src/armnn/layers/SpaceToDepthLayer.cpp +++ b/src/armnn/layers/SpaceToDepthLayer.cpp @@ -41,7 +41,7 @@ SpaceToDepthLayer* SpaceToDepthLayer::Clone(Graph& graph) const std::vector<TensorShape> SpaceToDepthLayer::InferOutputShapes(const std::vector<TensorShape>& inputShapes) const { - BOOST_ASSERT(inputShapes.size() == 1); + ARMNN_ASSERT(inputShapes.size() == 1); TensorShape inputShape = inputShapes[0]; TensorShape outputShape(inputShape); @@ -66,7 +66,7 @@ void SpaceToDepthLayer::ValidateTensorShapesFromInputs() std::vector<TensorShape> inferredShapes = InferOutputShapes({ GetInputSlot(0).GetConnection()->GetTensorInfo().GetShape() }); - BOOST_ASSERT(inferredShapes.size() == 1); + ARMNN_ASSERT(inferredShapes.size() == 1); ConditionalThrowIfNotEqual<LayerValidationException>( "SpaceToDepthLayer: TensorShape set on OutputSlot[0] does not match the inferred shape.", diff --git a/src/armnn/layers/SplitterLayer.cpp b/src/armnn/layers/SplitterLayer.cpp index f655e712c8..8ec8121495 100644 --- a/src/armnn/layers/SplitterLayer.cpp +++ b/src/armnn/layers/SplitterLayer.cpp @@ -115,7 +115,7 @@ void SplitterLayer::CreateTensorHandles(const TensorHandleFactoryRegistry& regis else { ITensorHandleFactory* handleFactory = registry.GetFactory(factoryId); - BOOST_ASSERT(handleFactory); + ARMNN_ASSERT(handleFactory); CreateTensors(*handleFactory); } } @@ -128,7 +128,7 @@ SplitterLayer* SplitterLayer::Clone(Graph& graph) const std::vector<TensorShape> SplitterLayer::InferOutputShapes(const std::vector<TensorShape>& inputShapes) const { IgnoreUnused(inputShapes); - BOOST_ASSERT(inputShapes.size() == m_Param.GetNumViews()); + ARMNN_ASSERT(inputShapes.size() == m_Param.GetNumViews()); std::vector<TensorShape> outShapes; //Output shapes must match View shapes. for (unsigned int viewIdx = 0; viewIdx < m_Param.GetNumViews(); viewIdx++) @@ -150,7 +150,7 @@ void SplitterLayer::ValidateTensorShapesFromInputs() auto inferredShapes = InferOutputShapes(views); - BOOST_ASSERT(inferredShapes.size() == m_Param.GetNumViews()); + ARMNN_ASSERT(inferredShapes.size() == m_Param.GetNumViews()); for (unsigned int viewIdx = 0; viewIdx < m_Param.GetNumViews(); viewIdx++) { diff --git a/src/armnn/layers/StackLayer.cpp b/src/armnn/layers/StackLayer.cpp index 6f793caecc..e034cb46a6 100644 --- a/src/armnn/layers/StackLayer.cpp +++ b/src/armnn/layers/StackLayer.cpp @@ -38,7 +38,7 @@ std::vector<TensorShape> StackLayer::InferOutputShapes(const std::vector<TensorS const unsigned int inputNumDimensions = inputShape.GetNumDimensions(); const unsigned int axis = m_Param.m_Axis; - BOOST_ASSERT(axis <= inputNumDimensions); + ARMNN_ASSERT(axis <= inputNumDimensions); std::vector<unsigned int> dimensionSizes(inputNumDimensions + 1, 0); for (unsigned int i = 0; i < axis; ++i) @@ -84,7 +84,7 @@ void StackLayer::ValidateTensorShapesFromInputs() auto inferredShapes = InferOutputShapes(inputShapes); - BOOST_ASSERT(inferredShapes.size() == 1); + ARMNN_ASSERT(inferredShapes.size() == 1); ConditionalThrowIfNotEqual<LayerValidationException>( "StackLayer: TensorShape set on OutputSlot[0] does not match the inferred shape.", diff --git a/src/armnn/layers/StridedSliceLayer.cpp b/src/armnn/layers/StridedSliceLayer.cpp index c31b9a4280..b100f7ab6b 100644 --- a/src/armnn/layers/StridedSliceLayer.cpp +++ b/src/armnn/layers/StridedSliceLayer.cpp @@ -45,7 +45,7 @@ StridedSliceLayer* StridedSliceLayer::Clone(Graph& graph) const std::vector<TensorShape> StridedSliceLayer::InferOutputShapes( const std::vector<TensorShape>& inputShapes) const { - BOOST_ASSERT(inputShapes.size() == 1); + ARMNN_ASSERT(inputShapes.size() == 1); TensorShape inputShape = inputShapes[0]; std::vector<unsigned int> outputShape; @@ -86,7 +86,7 @@ void StridedSliceLayer::ValidateTensorShapesFromInputs() auto inferredShapes = InferOutputShapes({GetInputSlot(0).GetConnection()->GetTensorInfo().GetShape()}); - BOOST_ASSERT(inferredShapes.size() == 1); + ARMNN_ASSERT(inferredShapes.size() == 1); ConditionalThrowIfNotEqual<LayerValidationException>( "StridedSlice: TensorShape set on OutputSlot[0] does not match the inferred shape.", diff --git a/src/armnn/layers/SwitchLayer.cpp b/src/armnn/layers/SwitchLayer.cpp index 4cacda6318..c4b065a735 100644 --- a/src/armnn/layers/SwitchLayer.cpp +++ b/src/armnn/layers/SwitchLayer.cpp @@ -31,14 +31,14 @@ void SwitchLayer::ValidateTensorShapesFromInputs() { VerifyLayerConnections(2, CHECK_LOCATION()); - BOOST_ASSERT_MSG(GetNumOutputSlots() == 2, "SwitchLayer: The layer should return 2 outputs."); + ARMNN_ASSERT_MSG(GetNumOutputSlots() == 2, "SwitchLayer: The layer should return 2 outputs."); // Assuming first input is the Input and second input is the Constant std::vector<TensorShape> inferredShapes = InferOutputShapes({ GetInputSlot(0).GetConnection()->GetTensorInfo().GetShape(), GetInputSlot(1).GetConnection()->GetTensorInfo().GetShape() }); - BOOST_ASSERT(inferredShapes.size() == 2); + ARMNN_ASSERT(inferredShapes.size() == 2); ConditionalThrowIfNotEqual<LayerValidationException>( "SwitchLayer: TensorShape set on OutputSlot[0] does not match the inferred shape.", diff --git a/src/armnn/layers/TransposeConvolution2dLayer.cpp b/src/armnn/layers/TransposeConvolution2dLayer.cpp index dca77b4c09..05941f7d78 100644 --- a/src/armnn/layers/TransposeConvolution2dLayer.cpp +++ b/src/armnn/layers/TransposeConvolution2dLayer.cpp @@ -26,14 +26,14 @@ TransposeConvolution2dLayer::TransposeConvolution2dLayer(const TransposeConvolut std::unique_ptr<IWorkload> TransposeConvolution2dLayer::CreateWorkload(const IWorkloadFactory& factory) const { - BOOST_ASSERT_MSG(m_Weight != nullptr, "TransposeConvolution2dLayer: Weights data should not be null."); + ARMNN_ASSERT_MSG(m_Weight != nullptr, "TransposeConvolution2dLayer: Weights data should not be null."); TransposeConvolution2dQueueDescriptor descriptor; descriptor.m_Weight = m_Weight.get(); if (m_Param.m_BiasEnabled) { - BOOST_ASSERT_MSG(m_Bias != nullptr, "TransposeConvolution2dLayer: Bias data should not be null."); + ARMNN_ASSERT_MSG(m_Bias != nullptr, "TransposeConvolution2dLayer: Bias data should not be null."); descriptor.m_Bias = m_Bias.get(); } @@ -57,11 +57,11 @@ TransposeConvolution2dLayer* TransposeConvolution2dLayer::Clone(Graph& graph) co std::vector<TensorShape> TransposeConvolution2dLayer::InferOutputShapes( const std::vector<TensorShape>& inputShapes) const { - BOOST_ASSERT(inputShapes.size() == 2); + ARMNN_ASSERT(inputShapes.size() == 2); const TensorShape& inputShape = inputShapes[0]; const TensorShape& kernelShape = inputShapes[1]; - BOOST_ASSERT_MSG(inputShape.GetNumDimensions() == 4, "Transpose convolutions will always have 4D input"); + ARMNN_ASSERT_MSG(inputShape.GetNumDimensions() == 4, "Transpose convolutions will always have 4D input"); DataLayoutIndexed dataLayoutIndex(m_Param.m_DataLayout); @@ -82,8 +82,8 @@ std::vector<TensorShape> TransposeConvolution2dLayer::InferOutputShapes( unsigned int kernelElements = kernelShape[0] * kernelShape[dataLayoutIndex.GetChannelsIndex()]; unsigned int inputElements = batches * inputShape[dataLayoutIndex.GetChannelsIndex()]; - BOOST_ASSERT_MSG(inputElements != 0, "Invalid number of input elements"); - BOOST_ASSERT_MSG(kernelElements % inputElements == 0, "Invalid number of elements"); + ARMNN_ASSERT_MSG(inputElements != 0, "Invalid number of input elements"); + ARMNN_ASSERT_MSG(kernelElements % inputElements == 0, "Invalid number of elements"); unsigned int channels = kernelElements / inputElements; @@ -98,13 +98,13 @@ void TransposeConvolution2dLayer::ValidateTensorShapesFromInputs() { VerifyLayerConnections(1, CHECK_LOCATION()); - BOOST_ASSERT_MSG(m_Weight != nullptr, "TransposeConvolution2dLayer: Weight data cannot be null."); + ARMNN_ASSERT_MSG(m_Weight != nullptr, "TransposeConvolution2dLayer: Weight data cannot be null."); auto inferredShapes = InferOutputShapes({ GetInputSlot(0).GetConnection()->GetTensorInfo().GetShape(), m_Weight->GetTensorInfo().GetShape() }); - BOOST_ASSERT(inferredShapes.size() == 1); + ARMNN_ASSERT(inferredShapes.size() == 1); ConditionalThrowIfNotEqual<LayerValidationException>( "TransposeConvolution2dLayer: TensorShape set on OutputSlot[0] does not match the inferred shape.", diff --git a/src/armnn/layers/TransposeLayer.cpp b/src/armnn/layers/TransposeLayer.cpp index 3c22b545b9..c058332c90 100644 --- a/src/armnn/layers/TransposeLayer.cpp +++ b/src/armnn/layers/TransposeLayer.cpp @@ -35,7 +35,7 @@ TransposeLayer* TransposeLayer::Clone(Graph& graph) const std::vector<TensorShape> TransposeLayer::InferOutputShapes(const std::vector<TensorShape>& inputShapes) const { - BOOST_ASSERT(inputShapes.size() == 1); + ARMNN_ASSERT(inputShapes.size() == 1); const TensorShape& inShape = inputShapes[0]; return std::vector<TensorShape> ({armnnUtils::TransposeTensorShape(inShape, m_Param.m_DimMappings)}); } @@ -46,7 +46,7 @@ void TransposeLayer::ValidateTensorShapesFromInputs() auto inferredShapes = InferOutputShapes({ GetInputSlot(0).GetConnection()->GetTensorInfo().GetShape() }); - BOOST_ASSERT(inferredShapes.size() == 1); + ARMNN_ASSERT(inferredShapes.size() == 1); ConditionalThrowIfNotEqual<LayerValidationException>( "TransposeLayer: TensorShape set on OutputSlot[0] does not match the inferred shape.", |