ArmNN
 22.08
FoldPadIntoConvolution2dImpl Class Reference

#include <FoldPadIntoLayer2d.hpp>

Public Member Functions

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

Protected Member Functions

 FoldPadIntoConvolution2dImpl ()=default
 
 ~FoldPadIntoConvolution2dImpl ()=default
 

Detailed Description

Definition at line 189 of file FoldPadIntoLayer2d.hpp.

Constructor & Destructor Documentation

◆ FoldPadIntoConvolution2dImpl()

◆ ~FoldPadIntoConvolution2dImpl()

Member Function Documentation

◆ Run()

void Run ( Graph graph,
InputSlot connection 
) const
inline

Definition at line 192 of file FoldPadIntoLayer2d.hpp.

References ARMNN_ASSERT_MSG, FoldPadIntoConvolution2dImpl::FoldPadIntoConvolution2dImpl(), InputSlot::GetOwningLayer(), and FoldPadIntoConvolution2dImpl::~FoldPadIntoConvolution2dImpl().

193  {
194  const auto newConv2dLayer = FoldPadIntoLayer2dImpl<Convolution2dLayer>(graph, connection);
195 
196  if (newConv2dLayer != nullptr)
197  {
198  const auto conv2dLayer = PolymorphicDowncast<Convolution2dLayer*>(&connection.GetOwningLayer());
199  // Copy weights and bias to the new convolution layer
200  ARMNN_ASSERT_MSG(newConv2dLayer->GetInputSlot(1).GetConnection() != nullptr,
201  "FoldPadIntoConvolution2d: New convolution layer is missing connection to weights layer");
202 
203  // Deprecated 22.11
204  newConv2dLayer->m_Weight = std::move(conv2dLayer->m_Weight);
205 
206  if (conv2dLayer->GetParameters().m_BiasEnabled)
207  {
208  ARMNN_ASSERT_MSG(newConv2dLayer->GetInputSlot(2).GetConnection() != nullptr,
209  "FoldPadIntoConvolution2d: New convolution layer is missing "
210  "connection to bias layer.");
211 
212  // Deprecated 22.11
213  newConv2dLayer->m_Bias = std::move(conv2dLayer->m_Bias);
214  }
215  }
216  }
#define ARMNN_ASSERT_MSG(COND, MSG)
Definition: Assert.hpp:15

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