ArmNN
 22.02
FoldPadIntoDepthwiseConvolution2dImpl Class Reference

#include <FoldPadIntoLayer2d.hpp>

Public Member Functions

void Run (Graph &graph, InputSlot &connection) const
 

Protected Member Functions

 FoldPadIntoDepthwiseConvolution2dImpl ()=default
 
 ~FoldPadIntoDepthwiseConvolution2dImpl ()=default
 

Detailed Description

Definition at line 189 of file FoldPadIntoLayer2d.hpp.

Constructor & Destructor Documentation

◆ FoldPadIntoDepthwiseConvolution2dImpl()

◆ ~FoldPadIntoDepthwiseConvolution2dImpl()

Member Function Documentation

◆ Run()

void Run ( Graph graph,
InputSlot connection 
) const
inline

Definition at line 192 of file FoldPadIntoLayer2d.hpp.

References ARMNN_ASSERT_MSG, and InputSlot::GetOwningLayer().

193  {
194  const auto newConv2dLayer = FoldPadIntoLayer2dImpl<DepthwiseConvolution2dLayer>(graph, connection);
195 
196  if (newConv2dLayer != nullptr)
197  {
198  const auto conv2dLayer = PolymorphicDowncast<DepthwiseConvolution2dLayer*>(&connection.GetOwningLayer());
199  // Copy weights and bias to the new convolution layer
200  ARMNN_ASSERT_MSG(conv2dLayer->m_Weight != nullptr,
201  "FoldPadIntoDepthwiseConvolution2d: Weights data should not be null.");
202  newConv2dLayer->m_Weight = std::move(conv2dLayer->m_Weight);
203 
204  if (conv2dLayer->GetParameters().m_BiasEnabled)
205  {
206  ARMNN_ASSERT_MSG(conv2dLayer->m_Bias != nullptr,
207  "FoldPadIntoDepthwiseConvolution2d: Bias data should not be null if bias is enabled.");
208  newConv2dLayer->m_Bias = std::move(conv2dLayer->m_Bias);
209  }
210  }
211  }
#define ARMNN_ASSERT_MSG(COND, MSG)
Definition: Assert.hpp:15

The documentation for this class was generated from the following file: