From 0085978ac40ecd008195d635cd009a1d4f49fb74 Mon Sep 17 00:00:00 2001 From: Aron Virginas-Tar Date: Mon, 11 Feb 2019 12:21:27 +0000 Subject: IVGCVSW-2676 Make biases optional in ILayerVisitor for Convolution2D, DepthwiseConvolution2D and FullyConnected Change-Id: I3048504ff699fdb266488e7c07b7262e5843d4b0 Signed-off-by: Aron Virginas-Tar --- src/armnn/layers/DepthwiseConvolution2dLayer.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/armnn/layers/DepthwiseConvolution2dLayer.cpp') diff --git a/src/armnn/layers/DepthwiseConvolution2dLayer.cpp b/src/armnn/layers/DepthwiseConvolution2dLayer.cpp index a17673fc1e..a1ffe91792 100644 --- a/src/armnn/layers/DepthwiseConvolution2dLayer.cpp +++ b/src/armnn/layers/DepthwiseConvolution2dLayer.cpp @@ -122,16 +122,16 @@ Layer::ConstantTensors DepthwiseConvolution2dLayer::GetConstantTensorsByRef() void DepthwiseConvolution2dLayer::Accept(ILayerVisitor& visitor) const { - ConstTensor weightsTensor(m_Weight->GetTensorInfo(), m_Weight->Map(true)) ; + ConstTensor weightsTensor(m_Weight->GetTensorInfo(), m_Weight->Map(true)); + Optional optionalBiasTensor = EmptyOptional(); + if (GetParameters().m_BiasEnabled) { ConstTensor biasTensor(m_Bias->GetTensorInfo(), m_Bias->Map(true)); - visitor.VisitDepthwiseConvolution2dLayer(this, GetParameters(), weightsTensor, biasTensor, GetName()); - } - else - { - visitor.VisitDepthwiseConvolution2dLayer(this, GetParameters(), weightsTensor, GetName()); + optionalBiasTensor = Optional(biasTensor); } + + visitor.VisitDepthwiseConvolution2dLayer(this, GetParameters(), weightsTensor, optionalBiasTensor, GetName()); } } // namespace armnn -- cgit v1.2.1