diff options
Diffstat (limited to 'src/armnn')
80 files changed, 311 insertions, 316 deletions
diff --git a/src/armnn/Descriptors.cpp b/src/armnn/Descriptors.cpp index 95f9b5dd2b..8f4df79428 100644 --- a/src/armnn/Descriptors.cpp +++ b/src/armnn/Descriptors.cpp @@ -5,6 +5,8 @@ #include "armnn/Descriptors.hpp" #include "armnn/Logging.hpp" +#include <armnn/utility/Assert.hpp> + #include <algorithm> #include <array> #include <vector> @@ -195,7 +197,7 @@ const uint32_t* OriginsDescriptor::GetViewOrigin(uint32_t idx) const // Reorders the viewOrigins in accordance with the indices presented in newOrdering array. void OriginsDescriptor::ReorderOrigins(unsigned int* newOrdering, unsigned int numNewOrdering) { - BOOST_ASSERT_MSG(m_NumViews == numNewOrdering, "number of views must match number of " + ARMNN_ASSERT_MSG(m_NumViews == numNewOrdering, "number of views must match number of " "elements in the new ordering array"); std::vector<uint32_t*> viewOrigins(&m_ViewOrigins[0], &m_ViewOrigins[m_NumViews]); diff --git a/src/armnn/Graph.cpp b/src/armnn/Graph.cpp index 0d326adae7..78b08ecace 100644 --- a/src/armnn/Graph.cpp +++ b/src/armnn/Graph.cpp @@ -13,9 +13,9 @@ #include <armnn/Logging.hpp> #include <armnn/TypesUtils.hpp> #include <armnn/Utils.hpp> +#include <armnn/utility/Assert.hpp> #include <boost/polymorphic_cast.hpp> -#include <boost/assert.hpp> #include <boost/format.hpp> #include <unordered_map> @@ -142,7 +142,7 @@ Status Graph::SerializeToDot(std::ostream& stream) Status Graph::AllocateDynamicBuffers() { // Layers must be sorted in topological order - BOOST_ASSERT(m_LayersInOrder); + ARMNN_ASSERT(m_LayersInOrder); std::unordered_set<const ITensorHandle*> preallocatedTensors; std::unordered_map<const ITensorHandle*, unsigned int> handleReferenceCounts; @@ -268,7 +268,7 @@ void Graph::AddCompatibilityLayers(std::map<BackendId, std::unique_ptr<IBackendI auto MayNeedCompatibilityLayer = [](const Layer& layer) { // All layers should have been associated with a valid compute device at this point. - BOOST_ASSERT(layer.GetBackendId() != Compute::Undefined); + ARMNN_ASSERT(layer.GetBackendId() != Compute::Undefined); // Does not need another compatibility layer if a copy or import layer is already present. return layer.GetType() != LayerType::MemCopy && layer.GetType() != LayerType::MemImport; @@ -282,7 +282,7 @@ void Graph::AddCompatibilityLayers(std::map<BackendId, std::unique_ptr<IBackendI ForEachLayer([this, &backends, ®istry, MayNeedCompatibilityLayer, IsCompatibilityStrategy](Layer* srcLayer) { - BOOST_ASSERT(srcLayer); + ARMNN_ASSERT(srcLayer); if (!MayNeedCompatibilityLayer(*srcLayer)) { @@ -299,10 +299,10 @@ void Graph::AddCompatibilityLayers(std::map<BackendId, std::unique_ptr<IBackendI for (unsigned int srcConnectionIndex = 0; srcConnectionIndex < srcConnections.size(); srcConnectionIndex++) { InputSlot* dstInputSlot = srcConnections[srcConnectionIndex]; - BOOST_ASSERT(dstInputSlot); + ARMNN_ASSERT(dstInputSlot); EdgeStrategy strategy = srcEdgeStrategies[srcConnectionIndex]; - BOOST_ASSERT_MSG(strategy != EdgeStrategy::Undefined, + ARMNN_ASSERT_MSG(strategy != EdgeStrategy::Undefined, "Undefined memory strategy found while adding copy layers for compatibility"); const Layer& dstLayer = dstInputSlot->GetOwningLayer(); @@ -325,7 +325,7 @@ void Graph::AddCompatibilityLayers(std::map<BackendId, std::unique_ptr<IBackendI } else { - BOOST_ASSERT_MSG(strategy == EdgeStrategy::ExportToTarget, "Invalid edge strategy found."); + ARMNN_ASSERT_MSG(strategy == EdgeStrategy::ExportToTarget, "Invalid edge strategy found."); compLayer = InsertNewLayer<MemImportLayer>(*dstInputSlot, compLayerName.c_str()); } @@ -395,7 +395,7 @@ void Graph::AddCompatibilityLayers(std::map<BackendId, std::unique_ptr<IBackendI void Graph::SubstituteSubgraph(SubgraphView& subgraph, IConnectableLayer* substituteLayer) { - BOOST_ASSERT(substituteLayer != nullptr); + ARMNN_ASSERT(substituteLayer != nullptr); ReplaceSubgraphConnections(subgraph, substituteLayer); EraseSubgraphLayers(subgraph); @@ -420,7 +420,7 @@ void Graph::SubstituteSubgraph(SubgraphView& subgraph, const SubgraphView& subst void Graph::ReplaceSubgraphConnections(const SubgraphView& subgraph, IConnectableLayer* substituteLayer) { - BOOST_ASSERT(substituteLayer != nullptr); + ARMNN_ASSERT(substituteLayer != nullptr); // Create a new sub-graph with only the given layer, using // the given sub-graph as a reference of which parent graph to use @@ -430,13 +430,13 @@ void Graph::ReplaceSubgraphConnections(const SubgraphView& subgraph, IConnectabl void Graph::ReplaceSubgraphConnections(const SubgraphView& subgraph, const SubgraphView& substituteSubgraph) { - BOOST_ASSERT_MSG(!substituteSubgraph.GetLayers().empty(), "New sub-graph used for substitution must not be empty"); + ARMNN_ASSERT_MSG(!substituteSubgraph.GetLayers().empty(), "New sub-graph used for substitution must not be empty"); const SubgraphView::Layers& substituteSubgraphLayers = substituteSubgraph.GetLayers(); std::for_each(substituteSubgraphLayers.begin(), substituteSubgraphLayers.end(), [&](Layer* layer) { IgnoreUnused(layer); - BOOST_ASSERT_MSG(std::find(m_Layers.begin(), m_Layers.end(), layer) != m_Layers.end(), + ARMNN_ASSERT_MSG(std::find(m_Layers.begin(), m_Layers.end(), layer) != m_Layers.end(), "Substitute layer is not a member of graph"); }); @@ -449,8 +449,8 @@ void Graph::ReplaceSubgraphConnections(const SubgraphView& subgraph, const Subgr const SubgraphView::InputSlots& substituteSubgraphInputSlots = substituteSubgraph.GetInputSlots(); const SubgraphView::OutputSlots& substituteSubgraphOutputSlots = substituteSubgraph.GetOutputSlots(); - BOOST_ASSERT(subgraphNumInputSlots == substituteSubgraphInputSlots.size()); - BOOST_ASSERT(subgraphNumOutputSlots == substituteSubgraphOutputSlots.size()); + ARMNN_ASSERT(subgraphNumInputSlots == substituteSubgraphInputSlots.size()); + ARMNN_ASSERT(subgraphNumOutputSlots == substituteSubgraphOutputSlots.size()); // Disconnect the sub-graph and replace it with the substitute sub-graph @@ -458,14 +458,14 @@ void Graph::ReplaceSubgraphConnections(const SubgraphView& subgraph, const Subgr for (unsigned int inputSlotIdx = 0; inputSlotIdx < subgraphNumInputSlots; ++inputSlotIdx) { InputSlot* subgraphInputSlot = subgraphInputSlots.at(inputSlotIdx); - BOOST_ASSERT(subgraphInputSlot); + ARMNN_ASSERT(subgraphInputSlot); IOutputSlot* connectedOutputSlot = subgraphInputSlot->GetConnection(); - BOOST_ASSERT(connectedOutputSlot); + ARMNN_ASSERT(connectedOutputSlot); connectedOutputSlot->Disconnect(*subgraphInputSlot); IInputSlot* substituteInputSlot = substituteSubgraphInputSlots.at(inputSlotIdx); - BOOST_ASSERT(substituteInputSlot); + ARMNN_ASSERT(substituteInputSlot); connectedOutputSlot->Connect(*substituteInputSlot); } @@ -473,10 +473,10 @@ void Graph::ReplaceSubgraphConnections(const SubgraphView& subgraph, const Subgr for(unsigned int outputSlotIdx = 0; outputSlotIdx < subgraphNumOutputSlots; ++outputSlotIdx) { OutputSlot* subgraphOutputSlot = subgraphOutputSlots.at(outputSlotIdx); - BOOST_ASSERT(subgraphOutputSlot); + ARMNN_ASSERT(subgraphOutputSlot); OutputSlot* substituteOutputSlot = substituteSubgraphOutputSlots.at(outputSlotIdx); - BOOST_ASSERT(substituteOutputSlot); + ARMNN_ASSERT(substituteOutputSlot); subgraphOutputSlot->MoveAllConnections(*substituteOutputSlot); } } diff --git a/src/armnn/Graph.hpp b/src/armnn/Graph.hpp index 63bc8d062c..00ab8deaa0 100644 --- a/src/armnn/Graph.hpp +++ b/src/armnn/Graph.hpp @@ -11,6 +11,7 @@ #include <armnn/TensorFwd.hpp> #include <armnn/NetworkFwd.hpp> #include <armnn/Exceptions.hpp> +#include <armnn/utility/Assert.hpp> #include <list> #include <map> @@ -18,7 +19,6 @@ #include <unordered_set> #include <vector> -#include <boost/assert.hpp> #include <boost/iterator/transform_iterator.hpp> namespace armnn @@ -115,8 +115,8 @@ public: otherLayer->Reparent(*this, m_Layers.end()); }); - BOOST_ASSERT(other.m_PosInGraphMap.empty()); - BOOST_ASSERT(other.m_Layers.empty()); + ARMNN_ASSERT(other.m_PosInGraphMap.empty()); + ARMNN_ASSERT(other.m_Layers.empty()); return *this; } @@ -298,7 +298,7 @@ private: const size_t numErased = graph.m_PosInGraphMap.erase(this); IgnoreUnused(numErased); - BOOST_ASSERT(numErased == 1); + ARMNN_ASSERT(numErased == 1); } protected: @@ -356,7 +356,7 @@ public: { const size_t numErased = m_Graph->m_InputIds.erase(GetBindingId()); IgnoreUnused(numErased); - BOOST_ASSERT(numErased == 1); + ARMNN_ASSERT(numErased == 1); } }; @@ -382,14 +382,14 @@ public: { const size_t numErased = m_Graph->m_OutputIds.erase(GetBindingId()); IgnoreUnused(numErased); - BOOST_ASSERT(numErased == 1); + ARMNN_ASSERT(numErased == 1); } }; inline Graph::Iterator Graph::GetPosInGraph(Layer& layer) { auto it = m_PosInGraphMap.find(&layer); - BOOST_ASSERT(it != m_PosInGraphMap.end()); + ARMNN_ASSERT(it != m_PosInGraphMap.end()); return it->second; } @@ -429,7 +429,7 @@ inline LayerT* Graph::InsertNewLayer(OutputSlot& insertAfter, Args&&... args) const Iterator pos = std::next(GetPosInGraph(owningLayer)); LayerT* const layer = new LayerInGraph<LayerT>(*this, pos, std::forward<Args>(args)...); - BOOST_ASSERT(layer->GetNumInputSlots() == 1); + ARMNN_ASSERT(layer->GetNumInputSlots() == 1); insertAfter.MoveAllConnections(layer->GetOutputSlot()); insertAfter.Connect(layer->GetInputSlot(0)); @@ -449,7 +449,7 @@ inline void Graph::EraseLayer(Iterator pos) template <typename LayerT> inline void Graph::EraseLayer(LayerT*& layer) { - BOOST_ASSERT(layer != nullptr); + ARMNN_ASSERT(layer != nullptr); EraseLayer(GetPosInGraph(*layer)); layer = nullptr; } diff --git a/src/armnn/InternalTypes.cpp b/src/armnn/InternalTypes.cpp index 2fe38fc963..a9435b29f5 100644 --- a/src/armnn/InternalTypes.cpp +++ b/src/armnn/InternalTypes.cpp @@ -5,7 +5,7 @@ #include "InternalTypes.hpp" -#include <boost/assert.hpp> +#include <armnn/utility/Assert.hpp> namespace armnn { @@ -75,7 +75,7 @@ char const* GetLayerTypeAsCString(LayerType type) case LayerType::TransposeConvolution2d: return "TransposeConvolution2d"; case LayerType::Transpose: return "Transpose"; default: - BOOST_ASSERT_MSG(false, "Unknown layer type"); + ARMNN_ASSERT_MSG(false, "Unknown layer type"); return "Unknown"; } } diff --git a/src/armnn/Layer.cpp b/src/armnn/Layer.cpp index 29d85b5a4c..024a18862d 100644 --- a/src/armnn/Layer.cpp +++ b/src/armnn/Layer.cpp @@ -19,7 +19,7 @@ namespace armnn void InputSlot::Insert(Layer& layer) { - BOOST_ASSERT(layer.GetNumOutputSlots() == 1); + ARMNN_ASSERT(layer.GetNumOutputSlots() == 1); OutputSlot* const prevSlot = GetConnectedOutputSlot(); @@ -29,7 +29,7 @@ void InputSlot::Insert(Layer& layer) prevSlot->Disconnect(*this); // Connects inserted layer to parent. - BOOST_ASSERT(layer.GetNumInputSlots() == 1); + ARMNN_ASSERT(layer.GetNumInputSlots() == 1); int idx = prevSlot->Connect(layer.GetInputSlot(0)); prevSlot->SetEdgeStrategy(boost::numeric_cast<unsigned int>(idx), EdgeStrategy::Undefined); @@ -72,7 +72,7 @@ bool OutputSlot::IsTensorInfoSet() const bool OutputSlot::ValidateTensorShape(const TensorShape& shape) const { - BOOST_ASSERT_MSG(IsTensorInfoSet(), "TensorInfo must be set in order to validate the shape."); + ARMNN_ASSERT_MSG(IsTensorInfoSet(), "TensorInfo must be set in order to validate the shape."); return shape == m_OutputHandler.GetTensorInfo().GetShape(); } @@ -113,7 +113,7 @@ void OutputSlot::MoveAllConnections(OutputSlot& destination) { while (GetNumConnections() > 0) { - BOOST_ASSERT_MSG(m_EdgeStrategies[0] == EdgeStrategy::Undefined, + ARMNN_ASSERT_MSG(m_EdgeStrategies[0] == EdgeStrategy::Undefined, "Cannot move connections once memory strategies have be established."); InputSlot& connection = *GetConnection(0); @@ -131,7 +131,7 @@ unsigned int OutputSlot::CalculateIndexOnOwner() const return i; } } - BOOST_ASSERT_MSG(false, "Did not find slot on owner."); + ARMNN_ASSERT_MSG(false, "Did not find slot on owner."); return 0; // Error } @@ -223,7 +223,7 @@ void Layer::CollectWorkloadInputs(WorkloadDataCollector& dataCollector) const for (auto&& inputSlot : GetInputSlots()) { // The graph must be well-formed at this point. - BOOST_ASSERT(inputSlot.GetConnection()); + ARMNN_ASSERT(inputSlot.GetConnection()); const OutputHandler& outputHandler = inputSlot.GetConnectedOutputSlot()->GetOutputHandler(); dataCollector.Push(outputHandler.GetData(), outputHandler.GetTensorInfo()); } @@ -255,7 +255,7 @@ void Layer::CreateTensorHandles(const TensorHandleFactoryRegistry& registry, else { ITensorHandleFactory* handleFactory = registry.GetFactory(factoryId); - BOOST_ASSERT(handleFactory); + ARMNN_ASSERT(handleFactory); handler.CreateTensorHandles(*handleFactory, IsMemoryManaged); } } @@ -337,7 +337,7 @@ LayerPriority Layer::GetPriority() const void Layer::VerifyLayerConnections(unsigned int expectedConnections, const CheckLocation& location) const { - BOOST_ASSERT(GetNumInputSlots() == expectedConnections); + ARMNN_ASSERT(GetNumInputSlots() == expectedConnections); for (unsigned int i=0; i<expectedConnections; ++i) { @@ -370,8 +370,8 @@ void Layer::VerifyLayerConnections(unsigned int expectedConnections, const Check std::vector<TensorShape> Layer::InferOutputShapes(const std::vector<TensorShape>& inputShapes) const { - BOOST_ASSERT(GetNumInputSlots() != 0); - BOOST_ASSERT(GetNumOutputSlots() != 0); + ARMNN_ASSERT(GetNumInputSlots() != 0); + ARMNN_ASSERT(GetNumOutputSlots() != 0); // By default we return what we got, meaning the output shape(s) are the same as the input(s). // This only works if the number of inputs and outputs are the same. Since we are in the Layer diff --git a/src/armnn/LayerSupport.cpp b/src/armnn/LayerSupport.cpp index 73e54b3006..fe5b542867 100644 --- a/src/armnn/LayerSupport.cpp +++ b/src/armnn/LayerSupport.cpp @@ -10,7 +10,7 @@ #include <armnn/backends/IBackendInternal.hpp> -#include <boost/assert.hpp> +#include <armnn/utility/Assert.hpp> #include <cstring> #include <algorithm> @@ -144,7 +144,7 @@ bool IsConcatSupported(const BackendId& backend, char* reasonIfUnsupported, size_t reasonIfUnsupportedMaxLength) { - BOOST_ASSERT(inputs.size() > 0); + ARMNN_ASSERT(inputs.size() > 0); FORWARD_LAYER_SUPPORT_FUNC(backend, IsConcatSupported, inputs, output, descriptor); } @@ -418,7 +418,7 @@ bool IsMergerSupported(const BackendId& backend, char* reasonIfUnsupported, size_t reasonIfUnsupportedMaxLength) { - BOOST_ASSERT(inputs.size() > 0); + ARMNN_ASSERT(inputs.size() > 0); ARMNN_NO_DEPRECATE_WARN_BEGIN FORWARD_LAYER_SUPPORT_FUNC(backend, IsMergerSupported, inputs, output, descriptor); diff --git a/src/armnn/LoadedNetwork.cpp b/src/armnn/LoadedNetwork.cpp index 9d181e535a..9da988b9e5 100644 --- a/src/armnn/LoadedNetwork.cpp +++ b/src/armnn/LoadedNetwork.cpp @@ -13,6 +13,7 @@ #include <armnn/BackendRegistry.hpp> #include <armnn/Logging.hpp> +#include <armnn/utility/Assert.hpp> #include <backendsCommon/CpuTensorHandle.hpp> #include <armnn/backends/IMemoryManager.hpp> @@ -22,7 +23,6 @@ #include <LabelsAndEventClasses.hpp> #include <boost/polymorphic_cast.hpp> -#include <boost/assert.hpp> #include <boost/format.hpp> namespace armnn @@ -55,7 +55,7 @@ void AddLayerStructure(std::unique_ptr<TimelineUtilityMethods>& timelineUtils, for (auto&& input : layer.GetInputSlots()) { const IOutputSlot* source = input.GetConnectedOutputSlot(); - BOOST_ASSERT(source != NULL); + ARMNN_ASSERT(source != NULL); timelineUtils->CreateConnectionRelationship(ProfilingRelationshipType::RetentionLink, source->GetOwningLayerGuid(), layer.GetGuid()); @@ -304,7 +304,7 @@ TensorInfo LoadedNetwork::GetInputTensorInfo(LayerBindingId layerId) const { for (auto&& inputLayer : m_OptimizedNetwork->GetGraph().GetInputLayers()) { - BOOST_ASSERT_MSG(inputLayer->GetNumOutputSlots() == 1, "Input layer should have exactly 1 output slot"); + ARMNN_ASSERT_MSG(inputLayer->GetNumOutputSlots() == 1, "Input layer should have exactly 1 output slot"); if (inputLayer->GetBindingId() == layerId) { return inputLayer->GetOutputSlot(0).GetTensorInfo(); @@ -318,8 +318,8 @@ TensorInfo LoadedNetwork::GetOutputTensorInfo(LayerBindingId layerId) const { for (auto&& outputLayer : m_OptimizedNetwork->GetGraph().GetOutputLayers()) { - BOOST_ASSERT_MSG(outputLayer->GetNumInputSlots() == 1, "Output layer should have exactly 1 input slot"); - BOOST_ASSERT_MSG(outputLayer->GetInputSlot(0).GetConnection(), "Input slot on Output layer must be connected"); + ARMNN_ASSERT_MSG(outputLayer->GetNumInputSlots() == 1, "Output layer should have exactly 1 input slot"); + ARMNN_ASSERT_MSG(outputLayer->GetInputSlot(0).GetConnection(), "Input slot on Output layer must be connected"); if (outputLayer->GetBindingId() == layerId) { return outputLayer->GetInputSlot(0).GetConnection()->GetTensorInfo(); @@ -346,10 +346,10 @@ const IWorkloadFactory& LoadedNetwork::GetWorkloadFactory(const Layer& layer) co workloadFactory = it->second.first.get(); - BOOST_ASSERT_MSG(workloadFactory, "No workload factory"); + ARMNN_ASSERT_MSG(workloadFactory, "No workload factory"); std::string reasonIfUnsupported; - BOOST_ASSERT_MSG(IWorkloadFactory::IsLayerSupported(layer, {}, reasonIfUnsupported), + ARMNN_ASSERT_MSG(IWorkloadFactory::IsLayerSupported(layer, {}, reasonIfUnsupported), "Factory does not support layer"); IgnoreUnused(reasonIfUnsupported); return *workloadFactory; @@ -540,11 +540,11 @@ void LoadedNetwork::EnqueueInput(const BindableLayer& layer, ITensorHandle* tens inputQueueDescriptor.m_Inputs.push_back(tensorHandle); info.m_InputTensorInfos.push_back(tensorInfo); - BOOST_ASSERT_MSG(layer.GetNumOutputSlots() == 1, "Can only handle Input Layer with one output"); + ARMNN_ASSERT_MSG(layer.GetNumOutputSlots() == 1, "Can only handle Input Layer with one output"); const OutputHandler& handler = layer.GetOutputHandler(); const TensorInfo& outputTensorInfo = handler.GetTensorInfo(); ITensorHandle* outputTensorHandle = handler.GetData(); - BOOST_ASSERT_MSG(outputTensorHandle != nullptr, + ARMNN_ASSERT_MSG(outputTensorHandle != nullptr, "Data should have been allocated."); inputQueueDescriptor.m_Outputs.push_back(outputTensorHandle); info.m_OutputTensorInfos.push_back(outputTensorInfo); @@ -574,7 +574,7 @@ void LoadedNetwork::EnqueueInput(const BindableLayer& layer, ITensorHandle* tens // Create a mem copy workload for input since we did not import std::unique_ptr<IWorkload> inputWorkload = std::make_unique<CopyMemGenericWorkload>(inputQueueDescriptor, info); - BOOST_ASSERT_MSG(inputWorkload, "No input workload created"); + ARMNN_ASSERT_MSG(inputWorkload, "No input workload created"); std::unique_ptr<TimelineUtilityMethods> timelineUtils = TimelineUtilityMethods::GetTimelineUtils(m_ProfilingService); @@ -607,14 +607,14 @@ void LoadedNetwork::EnqueueOutput(const BindableLayer& layer, ITensorHandle* ten outputQueueDescriptor.m_Outputs.push_back(tensorHandle); info.m_OutputTensorInfos.push_back(tensorInfo); - BOOST_ASSERT_MSG(layer.GetNumInputSlots() == 1, "Output Layer should have exactly one input."); + ARMNN_ASSERT_MSG(layer.GetNumInputSlots() == 1, "Output Layer should have exactly one input."); // Gets the output handler from the previous node. const OutputHandler& outputHandler = layer.GetInputSlots()[0].GetConnectedOutputSlot()->GetOutputHandler(); const TensorInfo& inputTensorInfo = outputHandler.GetTensorInfo(); ITensorHandle* inputTensorHandle = outputHandler.GetData(); - BOOST_ASSERT_MSG(inputTensorHandle != nullptr, "Data should have been allocated."); + ARMNN_ASSERT_MSG(inputTensorHandle != nullptr, "Data should have been allocated."); // Try import the output tensor. // Note: We can only import the output pointer if all of the following hold true: @@ -641,7 +641,7 @@ void LoadedNetwork::EnqueueOutput(const BindableLayer& layer, ITensorHandle* ten syncDesc.m_Inputs.push_back(inputTensorHandle); info.m_InputTensorInfos.push_back(inputTensorInfo); auto syncWorkload = std::make_unique<SyncMemGenericWorkload>(syncDesc, info); - BOOST_ASSERT_MSG(syncWorkload, "No sync workload created"); + ARMNN_ASSERT_MSG(syncWorkload, "No sync workload created"); m_OutputQueue.push_back(move(syncWorkload)); } else @@ -667,7 +667,7 @@ void LoadedNetwork::EnqueueOutput(const BindableLayer& layer, ITensorHandle* ten std::unique_ptr<IWorkload> outputWorkload = std::make_unique<CopyMemGenericWorkload>(outputQueueDescriptor, info); - BOOST_ASSERT_MSG(outputWorkload, "No output workload created"); + ARMNN_ASSERT_MSG(outputWorkload, "No output workload created"); std::unique_ptr<TimelineUtilityMethods> timelineUtils = TimelineUtilityMethods::GetTimelineUtils(m_ProfilingService); diff --git a/src/armnn/Logging.cpp b/src/armnn/Logging.cpp index ba401233ae..a3ca7ce118 100644 --- a/src/armnn/Logging.cpp +++ b/src/armnn/Logging.cpp @@ -6,6 +6,7 @@ #include <armnn/Logging.hpp> #include <armnn/utility/IgnoreUnused.hpp> #include <armnn/Utils.hpp> +#include <armnn/utility/Assert.hpp> #if defined(_MSC_VER) #ifndef NOMINMAX @@ -19,7 +20,6 @@ #include <android/log.h> #endif -#include <boost/assert.hpp> #include <iostream> namespace armnn @@ -54,7 +54,7 @@ void SetLogFilter(LogSeverity level) SimpleLogger<LogSeverity::Fatal>::Get().Enable(true); break; default: - BOOST_ASSERT(false); + ARMNN_ASSERT(false); } } diff --git a/src/armnn/Network.cpp b/src/armnn/Network.cpp index a443721a45..ac5159a855 100644 --- a/src/armnn/Network.cpp +++ b/src/armnn/Network.cpp @@ -22,6 +22,7 @@ #include <armnn/TypesUtils.hpp> #include <armnn/BackendRegistry.hpp> #include <armnn/Logging.hpp> +#include <armnn/utility/Assert.hpp> #include <armnn/utility/IgnoreUnused.hpp> #include <ProfilingService.hpp> @@ -33,7 +34,6 @@ #include <vector> #include <algorithm> -#include <boost/assert.hpp> #include <boost/format.hpp> #include <boost/numeric/conversion/converter_policies.hpp> #include <boost/cast.hpp> @@ -473,7 +473,7 @@ OptimizationResult AssignBackends(OptimizedNetwork* optNetObjPtr, } else { - BOOST_ASSERT_MSG(res.IsWarningOnly(), "OptimizationResult in unexpected state."); + ARMNN_ASSERT_MSG(res.IsWarningOnly(), "OptimizationResult in unexpected state."); } } } @@ -527,7 +527,7 @@ BackendsMap CreateSupportedBackends(TensorHandleFactoryRegistry& handleFactoryRe { auto backendFactory = backendRegistry.GetFactory(selectedBackend); auto backendObjPtr = backendFactory(); - BOOST_ASSERT(backendObjPtr); + ARMNN_ASSERT(backendObjPtr); backendObjPtr->RegisterTensorHandleFactories(handleFactoryRegistry); @@ -542,7 +542,7 @@ OptimizationResult ApplyBackendOptimizations(OptimizedNetwork* optNetObjPtr, BackendsMap& backends, Optional<std::vector<std::string>&> errMessages) { - BOOST_ASSERT(optNetObjPtr); + ARMNN_ASSERT(optNetObjPtr); OptimizationResult result; @@ -553,7 +553,7 @@ OptimizationResult ApplyBackendOptimizations(OptimizedNetwork* optNetObjPtr, for (auto&& selectedBackend : backendSettings.m_SelectedBackends) { auto backendObjPtr = backends.find(selectedBackend)->second.get(); - BOOST_ASSERT(backendObjPtr); + ARMNN_ASSERT(backendObjPtr); // Select sub-graphs based on backend SubgraphViewSelector::Subgraphs subgraphs = @@ -576,7 +576,7 @@ OptimizationResult ApplyBackendOptimizations(OptimizedNetwork* optNetObjPtr, { // Try to optimize the current sub-graph OptimizationViews optimizationViews = backendObjPtr->OptimizeSubgraphView(*subgraph); - BOOST_ASSERT(optimizationViews.Validate(*subgraph)); + ARMNN_ASSERT(optimizationViews.Validate(*subgraph)); // Optimization attempted, check the resulting optimized sub-graph for (auto& substitution : optimizationViews.GetSubstitutions()) @@ -589,7 +589,7 @@ OptimizationResult ApplyBackendOptimizations(OptimizedNetwork* optNetObjPtr, // Assign the current backend to the optimized sub-graph std::for_each(replacementSubgraph.begin(), replacementSubgraph.end(), [&selectedBackend](Layer* l) { - BOOST_ASSERT(l); + ARMNN_ASSERT(l); l->SetBackendId(selectedBackend); }); } @@ -660,7 +660,7 @@ ITensorHandleFactory::FactoryId CalculateSlotOptionForInput(BackendsMap& backend TensorHandleFactoryRegistry& registry) { Layer& layer = slot.GetOwningLayer(); - BOOST_ASSERT(layer.GetType() == LayerType::Input); + ARMNN_ASSERT(layer.GetType() == LayerType::Input); // Explicitly select the tensorhandle factory for InputLayer because the rules for it are slightly different. It // doesn't matter which backend it is assigned to because they all use the same implementation, which @@ -686,7 +686,7 @@ ITensorHandleFactory::FactoryId CalculateSlotOptionForInput(BackendsMap& backend const Layer& connectedLayer = connection->GetOwningLayer(); auto toBackend = backends.find(connectedLayer.GetBackendId()); - BOOST_ASSERT_MSG(toBackend != backends.end(), "Backend id not found for the connected layer"); + ARMNN_ASSERT_MSG(toBackend != backends.end(), "Backend id not found for the connected layer"); if (!toBackend->second.get()->SupportsTensorAllocatorAPI()) { @@ -802,7 +802,7 @@ ITensorHandleFactory::FactoryId CalculateSlotOption(BackendsMap& backends, const Layer& connectedLayer = connection->GetOwningLayer(); auto toBackend = backends.find(connectedLayer.GetBackendId()); - BOOST_ASSERT_MSG(toBackend != backends.end(), "Backend id not found for the connected layer"); + ARMNN_ASSERT_MSG(toBackend != backends.end(), "Backend id not found for the connected layer"); auto dstPrefs = toBackend->second.get()->GetHandleFactoryPreferences(); for (auto&& src : srcPrefs) @@ -863,7 +863,7 @@ EdgeStrategy CalculateEdgeStrategy(BackendsMap& backends, TensorHandleFactoryRegistry& registry) { auto toBackend = backends.find(connectedLayer.GetBackendId()); - BOOST_ASSERT_MSG(toBackend != backends.end(), "Backend id not found for the connected layer"); + ARMNN_ASSERT_MSG(toBackend != backends.end(), "Backend id not found for the connected layer"); auto dstPrefs = toBackend->second.get()->GetHandleFactoryPreferences(); @@ -942,11 +942,11 @@ OptimizationResult SelectTensorHandleStrategy(Graph& optGraph, optGraph.ForEachLayer([&backends, ®istry, &result, &errMessages](Layer* layer) { - BOOST_ASSERT(layer); + ARMNN_ASSERT(layer); // Lets make sure the backend is in our list of supported backends. Something went wrong during backend // assignment if this check fails - BOOST_ASSERT(backends.find(layer->GetBackendId()) != backends.end()); + ARMNN_ASSERT(backends.find(layer->GetBackendId()) != backends.end()); // Check each output separately for (unsigned int slotIdx = 0; slotIdx < layer->GetNumOutputSlots(); slotIdx++) @@ -1132,7 +1132,7 @@ IOptimizedNetworkPtr Optimize(const INetwork& inNetwork, { auto factoryFun = BackendRegistryInstance().GetFactory(chosenBackend); auto backendPtr = factoryFun(); - BOOST_ASSERT(backendPtr.get() != nullptr); + ARMNN_ASSERT(backendPtr.get() != nullptr); ARMNN_NO_DEPRECATE_WARN_BEGIN auto backendSpecificOptimizations = backendPtr->GetOptimizations(); diff --git a/src/armnn/NetworkQuantizerUtils.cpp b/src/armnn/NetworkQuantizerUtils.cpp index 75473b4ae6..dd0affde25 100644 --- a/src/armnn/NetworkQuantizerUtils.cpp +++ b/src/armnn/NetworkQuantizerUtils.cpp @@ -33,7 +33,7 @@ ConstTensor CreateQuantizedConst(const ConstTensor& tensor, std::vector<uint8_t> } break; default: - BOOST_ASSERT_MSG(false, "Can't quantize unsupported data type"); + ARMNN_ASSERT_MSG(false, "Can't quantize unsupported data type"); } TensorInfo qInfo(tensor.GetInfo().GetShape(), DataType::QAsymmU8, scale, offset); diff --git a/src/armnn/NetworkQuantizerUtils.hpp b/src/armnn/NetworkQuantizerUtils.hpp index 303a118a4e..dd274f9e35 100644 --- a/src/armnn/NetworkQuantizerUtils.hpp +++ b/src/armnn/NetworkQuantizerUtils.hpp @@ -10,20 +10,19 @@ #include <armnn/Tensor.hpp> #include <armnn/TypesUtils.hpp> #include <armnn/ILayerVisitor.hpp> +#include <armnn/utility/Assert.hpp> #include <utility> #include <limits> -#include <boost/assert.hpp> - namespace armnn { template<typename srcType> void QuantizeConstant(const srcType* src, uint8_t* dst, size_t numElements, float& scale, int& offset) { - BOOST_ASSERT(src); - BOOST_ASSERT(dst); + ARMNN_ASSERT(src); + ARMNN_ASSERT(dst); float min = std::numeric_limits<srcType>::max(); float max = std::numeric_limits<srcType>::lowest(); diff --git a/src/armnn/NetworkUtils.cpp b/src/armnn/NetworkUtils.cpp index 0549a115d4..285da4c9a9 100644 --- a/src/armnn/NetworkUtils.cpp +++ b/src/armnn/NetworkUtils.cpp @@ -245,7 +245,7 @@ std::vector<DebugLayer*> InsertDebugLayerAfter(Graph& graph, Layer& layer) graph.InsertNewLayer<DebugLayer>(*outputSlot, debugName.c_str()); // Sets output tensor info for the debug layer. - BOOST_ASSERT(debugLayer->GetInputSlot(0).GetConnectedOutputSlot() == &(*outputSlot)); + ARMNN_ASSERT(debugLayer->GetInputSlot(0).GetConnectedOutputSlot() == &(*outputSlot)); TensorInfo debugInfo = debugLayer->GetInputSlot(0).GetConnectedOutputSlot()->GetTensorInfo(); debugLayer->GetOutputSlot().SetTensorInfo(debugInfo); diff --git a/src/armnn/Optimizer.cpp b/src/armnn/Optimizer.cpp index 0a31f84654..cfb069333b 100644 --- a/src/armnn/Optimizer.cpp +++ b/src/armnn/Optimizer.cpp @@ -28,7 +28,7 @@ void Optimizer::Pass(Graph& graph, const Optimizations& optimizations) --it; for (auto&& optimization : optimizations) { - BOOST_ASSERT(*it); + ARMNN_ASSERT(*it); optimization->Run(graph, **it); if ((*it)->IsOutputUnconnected()) diff --git a/src/armnn/OutputHandler.cpp b/src/armnn/OutputHandler.cpp index 5a542fdb2e..973d23b28e 100644 --- a/src/armnn/OutputHandler.cpp +++ b/src/armnn/OutputHandler.cpp @@ -9,8 +9,6 @@ #include <backendsCommon/WorkloadDataCollector.hpp> #include <backendsCommon/WorkloadFactory.hpp> -#include <boost/assert.hpp> - namespace armnn { diff --git a/src/armnn/OutputHandler.hpp b/src/armnn/OutputHandler.hpp index 9cfde20c12..352520a000 100644 --- a/src/armnn/OutputHandler.hpp +++ b/src/armnn/OutputHandler.hpp @@ -17,8 +17,6 @@ #include <string> #include <vector> -#include <boost/assert.hpp> - namespace armnn { diff --git a/src/armnn/OverrideInputRangeVisitor.cpp b/src/armnn/OverrideInputRangeVisitor.cpp index d0453fe326..6e5137b794 100644 --- a/src/armnn/OverrideInputRangeVisitor.cpp +++ b/src/armnn/OverrideInputRangeVisitor.cpp @@ -9,8 +9,6 @@ #include <armnn/utility/IgnoreUnused.hpp> -#include <boost/assert.hpp> - namespace armnn { diff --git a/src/armnn/Profiling.cpp b/src/armnn/Profiling.cpp index b1aedaab5a..7194064c11 100644 --- a/src/armnn/Profiling.cpp +++ b/src/armnn/Profiling.cpp @@ -5,6 +5,7 @@ #include "Profiling.hpp" #include <armnn/BackendId.hpp> +#include <armnn/utility/Assert.hpp> #include <armnn/utility/IgnoreUnused.hpp> #include "JsonPrinter.hpp" @@ -45,7 +46,7 @@ constexpr bool g_WriteReportToStdOutOnProfilerDestruction = false; Measurement FindMeasurement(const std::string& name, const Event* event) { - BOOST_ASSERT(event != nullptr); + ARMNN_ASSERT(event != nullptr); // Search though the measurements. for (const auto& measurement : event->GetMeasurements()) @@ -63,7 +64,7 @@ Measurement FindMeasurement(const std::string& name, const Event* event) std::vector<Measurement> FindKernelMeasurements(const Event* event) { - BOOST_ASSERT(event != nullptr); + ARMNN_ASSERT(event != nullptr); std::vector<Measurement> measurements; @@ -219,13 +220,13 @@ void Profiler::EndEvent(Event* event) { event->Stop(); - BOOST_ASSERT(!m_Parents.empty()); - BOOST_ASSERT(event == m_Parents.top()); + ARMNN_ASSERT(!m_Parents.empty()); + ARMNN_ASSERT(event == m_Parents.top()); m_Parents.pop(); Event* parent = m_Parents.empty() ? nullptr : m_Parents.top(); IgnoreUnused(parent); - BOOST_ASSERT(event->GetParentEvent() == parent); + ARMNN_ASSERT(event->GetParentEvent() == parent); #if ARMNN_STREAMLINE_ENABLED ANNOTATE_CHANNEL_END(uint32_t(m_Parents.size())); @@ -287,7 +288,7 @@ void ExtractJsonObjects(unsigned int inferenceIndex, JsonChildObject& parentObject, std::map<const Event*, std::vector<const Event*>> descendantsMap) { - BOOST_ASSERT(parentEvent); + ARMNN_ASSERT(parentEvent); std::vector<Measurement> instrumentMeasurements = parentEvent->GetMeasurements(); unsigned int childIdx=0; for(size_t measurementIndex = 0; measurementIndex < instrumentMeasurements.size(); ++measurementIndex, ++childIdx) @@ -299,7 +300,7 @@ void ExtractJsonObjects(unsigned int inferenceIndex, measurementObject.SetUnit(instrumentMeasurements[measurementIndex].m_Unit); measurementObject.SetType(JsonObjectType::Measurement); - BOOST_ASSERT(parentObject.NumChildren() == childIdx); + ARMNN_ASSERT(parentObject.NumChildren() == childIdx); parentObject.AddChild(measurementObject); } diff --git a/src/armnn/QuantizerVisitor.cpp b/src/armnn/QuantizerVisitor.cpp index 8e7c45f47f..16e8a602f8 100644 --- a/src/armnn/QuantizerVisitor.cpp +++ b/src/armnn/QuantizerVisitor.cpp @@ -24,15 +24,15 @@ QuantizerVisitor::QuantizerVisitor(const RangeTracker& rangeTracker, void QuantizerVisitor::SetQuantizedInputConnections(const IConnectableLayer* srcLayer, IConnectableLayer* quantizedLayer) { - BOOST_ASSERT(srcLayer); + ARMNN_ASSERT(srcLayer); for (unsigned int i = 0; i < srcLayer->GetNumInputSlots(); i++) { const IInputSlot& srcInputSlot = srcLayer->GetInputSlot(i); const InputSlot* inputSlot = boost::polymorphic_downcast<const InputSlot*>(&srcInputSlot); - BOOST_ASSERT(inputSlot); + ARMNN_ASSERT(inputSlot); const OutputSlot* outputSlot = inputSlot->GetConnectedOutputSlot(); - BOOST_ASSERT(outputSlot); + ARMNN_ASSERT(outputSlot); unsigned int slotIdx = outputSlot->CalculateIndexOnOwner(); Layer& layerToFind = outputSlot->GetOwningLayer(); @@ -40,7 +40,7 @@ void QuantizerVisitor::SetQuantizedInputConnections(const IConnectableLayer* src if (found == m_OriginalToQuantizedGuidMap.end()) { // Error in graph traversal order - BOOST_ASSERT_MSG(false, "Error in graph traversal"); + ARMNN_ASSERT_MSG(false, "Error in graph traversal"); return; } @@ -68,13 +68,13 @@ ConstTensor QuantizerVisitor::CreateQuantizedBias(const IConnectableLayer* srcLa const Optional<ConstTensor>& biases, std::vector<int32_t>& backing) { - BOOST_ASSERT(srcLayer); + ARMNN_ASSERT(srcLayer); const IInputSlot& srcInputSlot = srcLayer->GetInputSlot(0); auto inputSlot = boost::polymorphic_downcast<const InputSlot*>(&srcInputSlot); - BOOST_ASSERT(inputSlot); + ARMNN_ASSERT(inputSlot); const OutputSlot* outputSlot = inputSlot->GetConnectedOutputSlot(); - BOOST_ASSERT(outputSlot); + ARMNN_ASSERT(outputSlot); unsigned int slotIdx = outputSlot->CalculateIndexOnOwner(); Layer& layerToFind = outputSlot->GetOwningLayer(); @@ -82,7 +82,7 @@ ConstTensor QuantizerVisitor::CreateQuantizedBias(const IConnectableLayer* srcLa if (found == m_OriginalToQuantizedGuidMap.end()) { // Error in graph traversal order - BOOST_ASSERT_MSG(false, "Error in graph traversal"); + ARMNN_ASSERT_MSG(false, "Error in graph traversal"); return biases.value(); } diff --git a/src/armnn/Runtime.cpp b/src/armnn/Runtime.cpp index dfcbf852e0..f44606c762 100644 --- a/src/armnn/Runtime.cpp +++ b/src/armnn/Runtime.cpp @@ -192,7 +192,7 @@ Runtime::Runtime(const CreationOptions& options) try { auto factoryFun = BackendRegistryInstance().GetFactory(id); auto backend = factoryFun(); - BOOST_ASSERT(backend.get() != nullptr); + ARMNN_ASSERT(backend.get() != nullptr); auto context = backend->CreateBackendContext(options); diff --git a/src/armnn/SubgraphView.cpp b/src/armnn/SubgraphView.cpp index 7705e687a9..446485f415 100644 --- a/src/armnn/SubgraphView.cpp +++ b/src/armnn/SubgraphView.cpp @@ -28,10 +28,10 @@ void AssertIfNullsOrDuplicates(const C& container, const std::string& errorMessa IgnoreUnused(errorMessage); // Check if the item is valid - BOOST_ASSERT_MSG(i, errorMessage.c_str()); + ARMNN_ASSERT_MSG(i, errorMessage.c_str()); // Check if a duplicate has been found - BOOST_ASSERT_MSG(duplicateSet.find(i) == duplicateSet.end(), errorMessage.c_str()); + ARMNN_ASSERT_MSG(duplicateSet.find(i) == duplicateSet.end(), errorMessage.c_str()); duplicateSet.insert(i); }); diff --git a/src/armnn/SubgraphViewSelector.cpp b/src/armnn/SubgraphViewSelector.cpp index 02b7bdafa5..fa2fad9d4e 100644 --- a/src/armnn/SubgraphViewSelector.cpp +++ b/src/armnn/SubgraphViewSelector.cpp @@ -6,9 +6,9 @@ #include "SubgraphViewSelector.hpp" #include "Graph.hpp" +#include <armnn/utility/Assert.hpp> #include <armnn/utility/IgnoreUnused.hpp> -#include <boost/assert.hpp> #include <algorithm> #include <map> #include <queue> @@ -80,14 +80,14 @@ public: for (PartialSubgraph* a : m_Antecedents) { size_t numErased = a->m_Dependants.erase(this); - BOOST_ASSERT(numErased == 1); + ARMNN_ASSERT(numErased == 1); IgnoreUnused(numErased); a->m_Dependants.insert(m_Parent); } for (PartialSubgraph* a : m_Dependants) { size_t numErased = a->m_Antecedents.erase(this); - BOOST_ASSERT(numErased == 1); + ARMNN_ASSERT(numErased == 1); IgnoreUnused(numErased); a->m_Antecedents.insert(m_Parent); } @@ -197,7 +197,7 @@ struct LayerSelectionInfo for (auto&& slot = m_Layer->BeginInputSlots(); slot != m_Layer->EndInputSlots(); ++slot) { OutputSlot* parentLayerOutputSlot = slot->GetConnectedOutputSlot(); - BOOST_ASSERT_MSG(parentLayerOutputSlot != nullptr, "The input slots must be connected here."); + ARMNN_ASSERT_MSG(parentLayerOutputSlot != nullptr, "The input slots must be connected here."); if (parentLayerOutputSlot) { Layer& parentLayer = parentLayerOutputSlot->GetOwningLayer(); @@ -268,7 +268,7 @@ void ForEachLayerInput(LayerSelectionInfo::LayerInfoContainer& layerInfos, for (auto inputSlot : layer.GetInputSlots()) { auto connectedInput = boost::polymorphic_downcast<OutputSlot*>(inputSlot.GetConnection()); - BOOST_ASSERT_MSG(connectedInput, "Dangling input slot detected."); + ARMNN_ASSERT_MSG(connectedInput, "Dangling input slot detected."); Layer& inputLayer = connectedInput->GetOwningLayer(); auto parentInfo = layerInfos.find(&inputLayer); diff --git a/src/armnn/Tensor.cpp b/src/armnn/Tensor.cpp index aeb7ab5fdd..4dc6f0dc34 100644 --- a/src/armnn/Tensor.cpp +++ b/src/armnn/Tensor.cpp @@ -8,7 +8,8 @@ #include "armnn/Exceptions.hpp" #include "armnn/TypesUtils.hpp" -#include <boost/assert.hpp> +#include <armnn/utility/Assert.hpp> + #include <boost/numeric/conversion/cast.hpp> #include <sstream> @@ -252,7 +253,7 @@ float TensorInfo::GetQuantizationScale() const return 1.0f; } - BOOST_ASSERT(!HasMultipleQuantizationScales()); + ARMNN_ASSERT(!HasMultipleQuantizationScales()); return m_Quantization.m_Scales[0]; } diff --git a/src/armnn/TypesUtils.cpp b/src/armnn/TypesUtils.cpp index f4f857f67a..9e58dc8f29 100644 --- a/src/armnn/TypesUtils.cpp +++ b/src/armnn/TypesUtils.cpp @@ -3,8 +3,8 @@ // SPDX-License-Identifier: MIT // #include <armnn/TypesUtils.hpp> +#include <armnn/utility/Assert.hpp> -#include <boost/assert.hpp> #include <boost/numeric/conversion/cast.hpp> namespace @@ -33,8 +33,8 @@ QuantizedType armnn::Quantize(float value, float scale, int32_t offset) static_assert(IsQuantizedType<QuantizedType>(), "Not an integer type."); constexpr QuantizedType max = std::numeric_limits<QuantizedType>::max(); constexpr QuantizedType min = std::numeric_limits<QuantizedType>::lowest(); - BOOST_ASSERT(scale != 0.f); - BOOST_ASSERT(!std::isnan(value)); + ARMNN_ASSERT(scale != 0.f); + ARMNN_ASSERT(!std::isnan(value)); float clampedValue = std::min(std::max(static_cast<float>(round(value/scale) + offset), static_cast<float>(min)), static_cast<float>(max)); @@ -47,8 +47,8 @@ template <typename QuantizedType> float armnn::Dequantize(QuantizedType value, float scale, int32_t offset) { static_assert(IsQuantizedType<QuantizedType>(), "Not an integer type."); - BOOST_ASSERT(scale != 0.f); - BOOST_ASSERT(!IsNan(value)); + ARMNN_ASSERT(scale != 0.f); + ARMNN_ASSERT(!IsNan(value)); float dequantized = boost::numeric_cast<float>(value - offset) * scale; return dequantized; } 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.", diff --git a/src/armnn/optimizations/FoldPadIntoConvolution2d.hpp b/src/armnn/optimizations/FoldPadIntoConvolution2d.hpp index b2a2ba43ed..e598deb977 100644 --- a/src/armnn/optimizations/FoldPadIntoConvolution2d.hpp +++ b/src/armnn/optimizations/FoldPadIntoConvolution2d.hpp @@ -21,8 +21,8 @@ public: Layer& base = connection.GetConnectedOutputSlot()->GetOwningLayer(); Layer& child = connection.GetOwningLayer(); - BOOST_ASSERT(base.GetType() == LayerType::Pad); - BOOST_ASSERT(child.GetType() == LayerType::Convolution2d); + ARMNN_ASSERT(base.GetType() == LayerType::Pad); + ARMNN_ASSERT(child.GetType() == LayerType::Convolution2d); PadLayer* padLayer = boost::polymorphic_downcast<PadLayer*>(&base); Convolution2dLayer* convolution2dLayer = boost::polymorphic_downcast<Convolution2dLayer*>(&child); @@ -60,12 +60,12 @@ public: newConv2dLayer.GetOutputHandler().SetTensorInfo(outInfo); // Copy weights and bias to the new convolution layer - BOOST_ASSERT_MSG(convolution2dLayer->m_Weight != nullptr, + ARMNN_ASSERT_MSG(convolution2dLayer->m_Weight != nullptr, "FoldPadIntoConvolution2d: Weights data should not be null."); newConv2dLayer.m_Weight = std::move(convolution2dLayer->m_Weight); if (descriptor.m_BiasEnabled) { - BOOST_ASSERT_MSG(convolution2dLayer->m_Bias != nullptr, + ARMNN_ASSERT_MSG(convolution2dLayer->m_Bias != nullptr, "FoldPadIntoConvolution2d: Bias data should not be null if bias is enabled."); newConv2dLayer.m_Bias = std::move(convolution2dLayer->m_Bias); } diff --git a/src/armnn/optimizations/OptimizeConsecutiveReshapes.hpp b/src/armnn/optimizations/OptimizeConsecutiveReshapes.hpp index 53d4a3c4fd..39bfe6e936 100644 --- a/src/armnn/optimizations/OptimizeConsecutiveReshapes.hpp +++ b/src/armnn/optimizations/OptimizeConsecutiveReshapes.hpp @@ -21,8 +21,8 @@ public: Layer& base = connection.GetConnectedOutputSlot()->GetOwningLayer(); Layer& child = connection.GetOwningLayer(); - BOOST_ASSERT(base.GetType() == LayerType::Reshape); - BOOST_ASSERT(child.GetType() == LayerType::Reshape); + ARMNN_ASSERT(base.GetType() == LayerType::Reshape); + ARMNN_ASSERT(child.GetType() == LayerType::Reshape); OutputSlot* parentOut = base.GetInputSlot(0).GetConnectedOutputSlot(); diff --git a/src/armnn/optimizations/OptimizeInverseConversions.hpp b/src/armnn/optimizations/OptimizeInverseConversions.hpp index 3ea4a5b279..d479445ce3 100644 --- a/src/armnn/optimizations/OptimizeInverseConversions.hpp +++ b/src/armnn/optimizations/OptimizeInverseConversions.hpp @@ -24,7 +24,7 @@ public: Layer& base = connection.GetConnectedOutputSlot()->GetOwningLayer(); Layer& child = connection.GetOwningLayer(); - BOOST_ASSERT((base.GetType() == LayerType::ConvertFp16ToFp32 && + ARMNN_ASSERT((base.GetType() == LayerType::ConvertFp16ToFp32 && child.GetType() == LayerType::ConvertFp32ToFp16) || (base.GetType() == LayerType::ConvertFp32ToFp16 && child.GetType() == LayerType::ConvertFp16ToFp32)); diff --git a/src/armnn/optimizations/PermuteAndBatchToSpaceAsDepthToSpace.hpp b/src/armnn/optimizations/PermuteAndBatchToSpaceAsDepthToSpace.hpp index 21aed869f5..ea4de9df6f 100644 --- a/src/armnn/optimizations/PermuteAndBatchToSpaceAsDepthToSpace.hpp +++ b/src/armnn/optimizations/PermuteAndBatchToSpaceAsDepthToSpace.hpp @@ -22,7 +22,7 @@ public: { // Validate base layer (the Permute) is compatible Layer& base = connection.GetConnectedOutputSlot()->GetOwningLayer(); - BOOST_ASSERT(base.GetType() == LayerType::Permute || base.GetType() == LayerType::Transpose); + ARMNN_ASSERT(base.GetType() == LayerType::Permute || base.GetType() == LayerType::Transpose); const TensorInfo& inputInfo = base.GetInputSlot(0).GetConnection()->GetTensorInfo(); const TensorInfo& intermediateInfo = base.GetOutputSlot(0).GetTensorInfo(); if (intermediateInfo.GetNumDimensions() != 4) @@ -39,7 +39,7 @@ public: // Validate child layer (the BatchToSpace) is compatible Layer& child = connection.GetOwningLayer(); - BOOST_ASSERT(child.GetType() == LayerType::BatchToSpaceNd); + ARMNN_ASSERT(child.GetType() == LayerType::BatchToSpaceNd); const TensorInfo& outputInfo = child.GetOutputSlot(0).GetTensorInfo(); const BatchToSpaceNdDescriptor& batchToSpaceDesc = static_cast<BatchToSpaceNdLayer&>(child).GetParameters(); if (batchToSpaceDesc.m_DataLayout != DataLayout::NHWC) diff --git a/src/armnn/test/OptimizerTests.cpp b/src/armnn/test/OptimizerTests.cpp index a7b23dbd86..c7883ffdb8 100644 --- a/src/armnn/test/OptimizerTests.cpp +++ b/src/armnn/test/OptimizerTests.cpp @@ -203,8 +203,8 @@ BOOST_AUTO_TEST_CASE(InsertConvertersTest) { if(layer->GetType()==LayerType::Floor || layer->GetType() == LayerType::Addition) { - BOOST_ASSERT(layer->GetOutputSlot(0).GetTensorInfo().GetDataType() == DataType::Float16); - BOOST_ASSERT(layer->GetDataType() == DataType::Float16); + ARMNN_ASSERT(layer->GetOutputSlot(0).GetTensorInfo().GetDataType() == DataType::Float16); + ARMNN_ASSERT(layer->GetDataType() == DataType::Float16); } } @@ -223,18 +223,18 @@ BOOST_AUTO_TEST_CASE(InsertConvertersTest) { if (layer->GetType()==LayerType::Floor || layer->GetType() == LayerType::Addition) { - BOOST_ASSERT(layer->GetOutputSlot(0).GetTensorInfo().GetDataType() == DataType::Float32); - BOOST_ASSERT(layer->GetDataType() == DataType::Float32); + ARMNN_ASSERT(layer->GetOutputSlot(0).GetTensorInfo().GetDataType() == DataType::Float32); + ARMNN_ASSERT(layer->GetDataType() == DataType::Float32); } else if (layer->GetType() == LayerType::ConvertFp16ToFp32) { - BOOST_ASSERT(layer->GetOutputSlot(0).GetTensorInfo().GetDataType() == DataType::Float32); - BOOST_ASSERT(layer->GetDataType() == DataType::Float16); + ARMNN_ASSERT(layer->GetOutputSlot(0).GetTensorInfo().GetDataType() == DataType::Float32); + ARMNN_ASSERT(layer->GetDataType() == DataType::Float16); } else if (layer->GetType() == LayerType::ConvertFp32ToFp16) { - BOOST_ASSERT(layer->GetOutputSlot(0).GetTensorInfo().GetDataType() == DataType::Float16); - BOOST_ASSERT(layer->GetDataType() == DataType::Float32); + ARMNN_ASSERT(layer->GetOutputSlot(0).GetTensorInfo().GetDataType() == DataType::Float16); + ARMNN_ASSERT(layer->GetDataType() == DataType::Float32); } } diff --git a/src/armnn/test/QuantizerTest.cpp b/src/armnn/test/QuantizerTest.cpp index ef9b2da782..ebdfbc5a40 100644 --- a/src/armnn/test/QuantizerTest.cpp +++ b/src/armnn/test/QuantizerTest.cpp @@ -336,7 +336,7 @@ TensorInfo GetInputTensorInfo(const Network* network) { for (auto&& inputLayer : network->GetGraph().GetInputLayers()) { - BOOST_ASSERT_MSG(inputLayer->GetNumOutputSlots() == 1, "Input layer should have exactly 1 output slot"); + ARMNN_ASSERT_MSG(inputLayer->GetNumOutputSlots() == 1, "Input layer should have exactly 1 output slot"); return inputLayer->GetOutputSlot(0).GetTensorInfo(); } throw InvalidArgumentException("Network has no input layers"); diff --git a/src/armnn/test/TensorHelpers.hpp b/src/armnn/test/TensorHelpers.hpp index 3f8589353c..ca148edefb 100644 --- a/src/armnn/test/TensorHelpers.hpp +++ b/src/armnn/test/TensorHelpers.hpp @@ -5,10 +5,10 @@ #pragma once #include <armnn/Tensor.hpp> +#include <armnn/utility/Assert.hpp> #include <QuantizeHelper.hpp> -#include <boost/assert.hpp> #include <boost/multi_array.hpp> #include <boost/numeric/conversion/cast.hpp> #include <boost/random/uniform_real_distribution.hpp> @@ -192,7 +192,7 @@ boost::multi_array<T, n> MakeTensor(const armnn::TensorInfo& tensorInfo) template <typename T, std::size_t n> boost::multi_array<T, n> MakeTensor(const armnn::TensorInfo& tensorInfo, const std::vector<T>& flat) { - BOOST_ASSERT_MSG(flat.size() == tensorInfo.GetNumElements(), "Wrong number of components supplied to tensor"); + ARMNN_ASSERT_MSG(flat.size() == tensorInfo.GetNumElements(), "Wrong number of components supplied to tensor"); std::array<unsigned int, n> shape; diff --git a/src/armnn/test/TestUtils.cpp b/src/armnn/test/TestUtils.cpp index 8ef820b3d5..6d7d02dcff 100644 --- a/src/armnn/test/TestUtils.cpp +++ b/src/armnn/test/TestUtils.cpp @@ -5,15 +5,15 @@ #include "TestUtils.hpp" -#include <boost/assert.hpp> +#include <armnn/utility/Assert.hpp> using namespace armnn; void Connect(armnn::IConnectableLayer* from, armnn::IConnectableLayer* to, const armnn::TensorInfo& tensorInfo, unsigned int fromIndex, unsigned int toIndex) { - BOOST_ASSERT(from); - BOOST_ASSERT(to); + ARMNN_ASSERT(from); + ARMNN_ASSERT(to); from->GetOutputSlot(fromIndex).Connect(to->GetInputSlot(toIndex)); from->GetOutputSlot(fromIndex).SetTensorInfo(tensorInfo); |