ArmNN
 21.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 160 of file FoldPadIntoLayer2d.hpp.

Constructor & Destructor Documentation

◆ FoldPadIntoConvolution2dImpl()

◆ ~FoldPadIntoConvolution2dImpl()

Member Function Documentation

◆ Run()

void Run ( Graph graph,
InputSlot connection 
) const
inline

Definition at line 163 of file FoldPadIntoLayer2d.hpp.

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

164  {
165  const auto newConv2dLayer = FoldPadIntoLayer2dImpl<Convolution2dLayer>(graph, connection);
166 
167  if (newConv2dLayer != nullptr)
168  {
169  const auto conv2dLayer = PolymorphicDowncast<Convolution2dLayer*>(&connection.GetOwningLayer());
170  // Copy weights and bias to the new convolution layer
171  ARMNN_ASSERT_MSG(conv2dLayer->m_Weight != nullptr,
172  "FoldPadIntoConvolution2d: Weights data should not be null.");
173  newConv2dLayer->m_Weight = std::move(conv2dLayer->m_Weight);
174 
175  if (conv2dLayer->GetParameters().m_BiasEnabled)
176  {
177  ARMNN_ASSERT_MSG(conv2dLayer->m_Bias != nullptr,
178  "FoldPadIntoConvolution2d: Bias data should not be null if bias is enabled.");
179  newConv2dLayer->m_Bias = std::move(conv2dLayer->m_Bias);
180  }
181  }
182  }
#define ARMNN_ASSERT_MSG(COND, MSG)
Definition: Assert.hpp:15

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