diff options
Diffstat (limited to 'src/armnn/layers/FullyConnectedLayer.cpp')
-rw-r--r-- | src/armnn/layers/FullyConnectedLayer.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/armnn/layers/FullyConnectedLayer.cpp b/src/armnn/layers/FullyConnectedLayer.cpp index 219113bca6..98b81fa6a8 100644 --- a/src/armnn/layers/FullyConnectedLayer.cpp +++ b/src/armnn/layers/FullyConnectedLayer.cpp @@ -88,16 +88,16 @@ Layer::ConstantTensors FullyConnectedLayer::GetConstantTensorsByRef() void FullyConnectedLayer::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->GetConstTensor<void>()); - visitor.VisitFullyConnectedLayer(this, GetParameters(), weightsTensor, biasTensor, GetName()); - } - else - { - visitor.VisitFullyConnectedLayer(this, GetParameters(), weightsTensor, GetName()); + optionalBiasTensor = Optional<ConstTensor>(biasTensor); } + + visitor.VisitFullyConnectedLayer(this, GetParameters(), weightsTensor, optionalBiasTensor, GetName()); } } // namespace armnn |