ArmNN
 22.11
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 223 of file FoldPadIntoLayer2d.hpp.

Constructor & Destructor Documentation

◆ FoldPadIntoDepthwiseConvolution2dImpl()

◆ ~FoldPadIntoDepthwiseConvolution2dImpl()

Member Function Documentation

◆ Run()

void Run ( Graph graph,
InputSlot connection 
) const
inline

Definition at line 226 of file FoldPadIntoLayer2d.hpp.

References ARMNN_ASSERT_MSG, and InputSlot::GetOwningLayer().

227  {
228  const auto newConv2dLayer = FoldPadIntoLayer2dImpl<DepthwiseConvolution2dLayer>(graph, connection);
229 
230  if (newConv2dLayer != nullptr)
231  {
232  const auto conv2dLayer = PolymorphicDowncast<DepthwiseConvolution2dLayer*>(&connection.GetOwningLayer());
233  // Copy weights and bias to the new convolution layer
234  ARMNN_ASSERT_MSG(newConv2dLayer->GetInputSlot(1).GetConnection() != nullptr,
235  "FoldPadIntoDepthwiseConvolution2d: New convolution layer is missing connection to weights layer");
236 
237  // Deprecated. Removal date is 23.02.
238  newConv2dLayer->m_Weight = std::move(conv2dLayer->m_Weight);
239 
240  if (conv2dLayer->GetParameters().m_BiasEnabled)
241  {
242  ARMNN_ASSERT_MSG(newConv2dLayer->GetInputSlot(2).GetConnection() != nullptr,
243  "FoldPadIntoConvolution2d: New convolution layer is missing "
244  "connection to bias layer.");
245  // Deprecated. Removal date is 23.02.
246  newConv2dLayer->m_Bias = std::move(conv2dLayer->m_Bias);
247  }
248  }
249  }
#define ARMNN_ASSERT_MSG(COND, MSG)
Definition: Assert.hpp:15

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