diff options
author | Aron Virginas-Tar <Aron.Virginas-Tar@arm.com> | 2019-02-11 12:21:27 +0000 |
---|---|---|
committer | Aron Virginas-Tar <Aron.Virginas-Tar@arm.com> | 2019-02-11 13:33:20 +0000 |
commit | 0085978ac40ecd008195d635cd009a1d4f49fb74 (patch) | |
tree | 560c296e74b94826d6338b7d0d92224ae526a426 /src/armnn/layers/DepthwiseConvolution2dLayer.cpp | |
parent | 3dad5acc5d8eda6fc472b9a255c1d893d4e1f942 (diff) | |
download | armnn-0085978ac40ecd008195d635cd009a1d4f49fb74.tar.gz |
IVGCVSW-2676 Make biases optional in ILayerVisitor for Convolution2D, DepthwiseConvolution2D and FullyConnected
Change-Id: I3048504ff699fdb266488e7c07b7262e5843d4b0
Signed-off-by: Aron Virginas-Tar <Aron.Virginas-Tar@arm.com>
Diffstat (limited to 'src/armnn/layers/DepthwiseConvolution2dLayer.cpp')
-rw-r--r-- | src/armnn/layers/DepthwiseConvolution2dLayer.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
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<ConstTensor> 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<ConstTensor>(biasTensor); } + + visitor.VisitDepthwiseConvolution2dLayer(this, GetParameters(), weightsTensor, optionalBiasTensor, GetName()); } } // namespace armnn |