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

Constructor & Destructor Documentation

◆ FoldPadIntoConvolution2dImpl()

◆ ~FoldPadIntoConvolution2dImpl()

Member Function Documentation

◆ Run()

void Run ( Graph graph,
InputSlot connection 
) const
inline

Definition at line 177 of file FoldPadIntoLayer2d.hpp.

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

178  {
179  const auto newConv2dLayer = FoldPadIntoLayer2dImpl<Convolution2dLayer>(graph, connection);
180 
181  if (newConv2dLayer != nullptr)
182  {
183  const auto conv2dLayer = PolymorphicDowncast<Convolution2dLayer*>(&connection.GetOwningLayer());
184  // Copy weights and bias to the new convolution layer
185  ARMNN_ASSERT_MSG(newConv2dLayer->GetInputSlot(1).GetConnection() != nullptr,
186  "FoldPadIntoConvolution2d: New convolution layer is missing connection to weights layer");
187 
188  // Deprecated 22.11
189  newConv2dLayer->m_Weight = std::move(conv2dLayer->m_Weight);
190 
191  if (conv2dLayer->GetParameters().m_BiasEnabled)
192  {
193  ARMNN_ASSERT_MSG(newConv2dLayer->GetInputSlot(2).GetConnection() != nullptr,
194  "FoldPadIntoConvolution2d: New convolution layer is missing "
195  "connection to bias layer.");
196 
197  // Deprecated 22.11
198  newConv2dLayer->m_Bias = std::move(conv2dLayer->m_Bias);
199  }
200  }
201  }
#define ARMNN_ASSERT_MSG(COND, MSG)
Definition: Assert.hpp:15

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