ArmNN
 22.05
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 208 of file FoldPadIntoLayer2d.hpp.

Constructor & Destructor Documentation

◆ FoldPadIntoDepthwiseConvolution2dImpl()

◆ ~FoldPadIntoDepthwiseConvolution2dImpl()

Member Function Documentation

◆ Run()

void Run ( Graph graph,
InputSlot connection 
) const
inline

Definition at line 211 of file FoldPadIntoLayer2d.hpp.

References ARMNN_ASSERT_MSG, and InputSlot::GetOwningLayer().

212  {
213  const auto newConv2dLayer = FoldPadIntoLayer2dImpl<DepthwiseConvolution2dLayer>(graph, connection);
214 
215  if (newConv2dLayer != nullptr)
216  {
217  const auto conv2dLayer = PolymorphicDowncast<DepthwiseConvolution2dLayer*>(&connection.GetOwningLayer());
218  // Copy weights and bias to the new convolution layer
219  ARMNN_ASSERT_MSG(newConv2dLayer->GetInputSlot(1).GetConnection() != nullptr,
220  "FoldPadIntoDepthwiseConvolution2d: New convolution layer is missing connection to weights layer");
221 
222  // Deprecated 22.11
223  newConv2dLayer->m_Weight = std::move(conv2dLayer->m_Weight);
224 
225  if (conv2dLayer->GetParameters().m_BiasEnabled)
226  {
227  ARMNN_ASSERT_MSG(newConv2dLayer->GetInputSlot(2).GetConnection() != nullptr,
228  "FoldPadIntoConvolution2d: New convolution layer is missing "
229  "connection to bias layer.");
230  // Deprecated 22.11
231  newConv2dLayer->m_Bias = std::move(conv2dLayer->m_Bias);
232  }
233  }
234  }
#define ARMNN_ASSERT_MSG(COND, MSG)
Definition: Assert.hpp:15

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