From 5d7b0a314b3e354a6cbcf15f5dd78b50f1e02774 Mon Sep 17 00:00:00 2001 From: Matthew Sloyan Date: Mon, 18 Oct 2021 13:07:49 +0100 Subject: Add ConstTensorsAsInput support for Conv3d * Constant weights and biases are now stored as Constant layers. * Updated Serializer, Deserializer and unit tests to reflect this. * Updated TfLiteParser. * Updated Ref backend to handle constant weights and bias as inputs rather than reading from member variables. * Added Conv3d EndToEnd test. * Added NCDHW DataLayout and unit tests. Signed-off-by: Matthew Sloyan Change-Id: I10cdd354ca5f1c748730f92ffdb36bf810f83c8e --- src/armnn/Graph.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/armnn/Graph.cpp') diff --git a/src/armnn/Graph.cpp b/src/armnn/Graph.cpp index 30639b12e8..0591bea99a 100644 --- a/src/armnn/Graph.cpp +++ b/src/armnn/Graph.cpp @@ -588,7 +588,7 @@ void Graph::InferTensorInfos() } /// Throws exception due to a layer input not being connected to an output slot. -/// Verifies weights and bias are set for FullyConnected layers on input slots 1 +/// Verifies weights and bias are set for layers on input slots 1 /// and 2 respectively. Method checks if bias is enabled before ensuring it is set. /// /// @param layer constant pointer to a Layer object @@ -600,7 +600,8 @@ void Graph::ConstructErrorMessageForUnconnectedInputs(Layer* const layer, std::ostringstream message; bool noWeightsAndBias = false; - if (layer->GetType() == armnn::LayerType::FullyConnected && slotIndex > 0) + if ((layer->GetType() == armnn::LayerType::FullyConnected || + layer->GetType() == armnn::LayerType::Convolution3d) && slotIndex > 0) { // If weights are not set and is bias enabled, also check if bias is set if (slotIndex == 1 && layer->GetNumInputSlots() == 3) @@ -608,7 +609,7 @@ void Graph::ConstructErrorMessageForUnconnectedInputs(Layer* const layer, const IOutputSlot* biasSource = layer->GetInputSlot(2).GetConnectedOutputSlot(); if (biasSource == NULL) { - message << "FullyConnected layer weights and bias not set: "; + message << layer->GetName() << " layer weights and bias not set: "; noWeightsAndBias = true; } } @@ -618,11 +619,11 @@ void Graph::ConstructErrorMessageForUnconnectedInputs(Layer* const layer, { if (slotIndex == 1) { - message << "FullyConnected layer weights not set: "; + message << layer->GetName() << " layer weights not set: "; } else { - message << "FullyConnected layer bias not set: "; + message << layer->GetName() << " layer bias not set: "; } } } -- cgit v1.2.1