\hypertarget{classnntrainer_1_1props_1_1Padding2D}{}\doxysection{nntrainer\+::props\+::Padding2D Class Reference}
\label{classnntrainer_1_1props_1_1Padding2D}\index{nntrainer::props::Padding2D@{nntrainer::props::Padding2D}}


\mbox{\hyperlink{classnntrainer_1_1props_1_1Padding2D}{Padding2D}} property, this is used to calculate padding2D.  




{\ttfamily \#include $<$common\+\_\+properties.\+h$>$}



Inheritance diagram for nntrainer\+::props\+::Padding2D\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=232pt]{classnntrainer_1_1props_1_1Padding2D__inherit__graph}
\end{center}
\end{figure}


Collaboration diagram for nntrainer\+::props\+::Padding2D\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=232pt]{classnntrainer_1_1props_1_1Padding2D__coll__graph}
\end{center}
\end{figure}
\doxysubsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
using \mbox{\hyperlink{classnntrainer_1_1props_1_1Padding2D_a850d7d75b234d0d55dc6e7536eba18a6}{prop\+\_\+tag}} = str\+\_\+prop\+\_\+tag
\end{DoxyCompactItemize}
\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
bool \mbox{\hyperlink{classnntrainer_1_1props_1_1Padding2D_ad2dc82081012fd496086e27811618f0b}{is\+Valid}} (const std\+::string \&v) const override
\item 
std\+::array$<$ unsigned int, 4 $>$ \mbox{\hyperlink{classnntrainer_1_1props_1_1Padding2D_a1973cfb34ebc36904ae61390e3676c65}{compute}} (const Tensor\+Dim \&input, const Tensor\+Dim \&kernel, const std\+::array$<$ unsigned int, 2 $>$ \&strides, const std\+::array$<$ unsigned int, 2 $>$ \&dilation)
\begin{DoxyCompactList}\small\item\em compute actual padding2D from the underlying data \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Static Public Attributes}
\begin{DoxyCompactItemize}
\item 
static constexpr const char $\ast$ \mbox{\hyperlink{classnntrainer_1_1props_1_1Padding2D_a2ffb7b62ce5f13821fead68ae6d81071}{key}} = \char`\"{}padding\char`\"{}
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
\mbox{\hyperlink{classnntrainer_1_1props_1_1Padding2D}{Padding2D}} property, this is used to calculate padding2D. 

\mbox{\hyperlink{classnntrainer_1_1props_1_1Padding2D}{Padding2D}} is saved as a string. Upon calling \mbox{\hyperlink{classnntrainer_1_1props_1_1Padding2D_a1973cfb34ebc36904ae61390e3676c65}{Padding2\+D\+::compute}}, returns std\+::vector$<$unsigned int$>$ which has computed padding2\+Ds, below formats are accepted valid
\begin{DoxyEnumerate}
\item \char`\"{}same\char`\"{} (case insensitive literal string)
\item \char`\"{}valid\char`\"{} (case insensitive literal string)
\item \char`\"{}padding2\+D\+\_\+all\char`\"{}, eg) padding=1
\item \char`\"{}padding2\+D\+\_\+height, padding2\+D\+\_\+width\char`\"{} eg) padding=1,1
\item \char`\"{}padding2\+D\+\_\+top, padding2\+D\+\_\+bottom, padding2\+D\+\_\+left, padding2\+D\+\_\+right\char`\"{} eg) padding=1,1,1,1 
\end{DoxyEnumerate}

Definition at line 403 of file common\+\_\+properties.\+h.



\doxysubsection{Member Typedef Documentation}
\mbox{\Hypertarget{classnntrainer_1_1props_1_1Padding2D_a850d7d75b234d0d55dc6e7536eba18a6}\label{classnntrainer_1_1props_1_1Padding2D_a850d7d75b234d0d55dc6e7536eba18a6}} 
\index{nntrainer::props::Padding2D@{nntrainer::props::Padding2D}!prop\_tag@{prop\_tag}}
\index{prop\_tag@{prop\_tag}!nntrainer::props::Padding2D@{nntrainer::props::Padding2D}}
\doxysubsubsection{\texorpdfstring{prop\_tag}{prop\_tag}}
{\footnotesize\ttfamily using \mbox{\hyperlink{classnntrainer_1_1props_1_1Padding2D_a850d7d75b234d0d55dc6e7536eba18a6}{nntrainer\+::props\+::\+Padding2\+D\+::prop\+\_\+tag}} =  str\+\_\+prop\+\_\+tag}

property type 

Definition at line 413 of file common\+\_\+properties.\+h.



\doxysubsection{Member Function Documentation}
\mbox{\Hypertarget{classnntrainer_1_1props_1_1Padding2D_a1973cfb34ebc36904ae61390e3676c65}\label{classnntrainer_1_1props_1_1Padding2D_a1973cfb34ebc36904ae61390e3676c65}} 
\index{nntrainer::props::Padding2D@{nntrainer::props::Padding2D}!compute@{compute}}
\index{compute@{compute}!nntrainer::props::Padding2D@{nntrainer::props::Padding2D}}
\doxysubsubsection{\texorpdfstring{compute()}{compute()}}
{\footnotesize\ttfamily std\+::array$<$ unsigned int, 4 $>$ nntrainer\+::props\+::\+Padding2\+D\+::compute (\begin{DoxyParamCaption}\item[{const Tensor\+Dim \&}]{input,  }\item[{const Tensor\+Dim \&}]{kernel,  }\item[{const std\+::array$<$ unsigned int, 2 $>$ \&}]{strides,  }\item[{const std\+::array$<$ unsigned int, 2 $>$ \&}]{dilation }\end{DoxyParamCaption})}



compute actual padding2D from the underlying data 


\begin{DoxyParams}{Parameters}
{\em input} & input dimension \\
\hline
{\em kernel} & kernel dimension \\
\hline
{\em stride} & stride \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
std\+::array$<$unsigned int, 4$>$ list of unsigned padding 
\end{DoxyReturn}
padding representation

in the case of same padding, padding is distributed to each side if possible. otherwise pad\+\_\+all\+\_\+side / 2 is allocated to top $\vert$ left and rest are assigned to the other side

ceil(input / stride)

case 3, 4, 5\+: padding has a sequence of unsigned integer

Definition at line 148 of file common\+\_\+properties.\+cpp.

\mbox{\Hypertarget{classnntrainer_1_1props_1_1Padding2D_ad2dc82081012fd496086e27811618f0b}\label{classnntrainer_1_1props_1_1Padding2D_ad2dc82081012fd496086e27811618f0b}} 
\index{nntrainer::props::Padding2D@{nntrainer::props::Padding2D}!isValid@{isValid}}
\index{isValid@{isValid}!nntrainer::props::Padding2D@{nntrainer::props::Padding2D}}
\doxysubsubsection{\texorpdfstring{isValid()}{isValid()}}
{\footnotesize\ttfamily bool nntrainer\+::props\+::\+Padding2\+D\+::is\+Valid (\begin{DoxyParamCaption}\item[{const std\+::string \&}]{v }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [override]}}

case 1, 2\+: padding has string literal

case 3, 4, 5\+: padding has a sequence of unsigned integer

check if every padding is non-\/negative integer

case else\+: false

Definition at line 122 of file common\+\_\+properties.\+cpp.



\doxysubsection{Member Data Documentation}
\mbox{\Hypertarget{classnntrainer_1_1props_1_1Padding2D_a2ffb7b62ce5f13821fead68ae6d81071}\label{classnntrainer_1_1props_1_1Padding2D_a2ffb7b62ce5f13821fead68ae6d81071}} 
\index{nntrainer::props::Padding2D@{nntrainer::props::Padding2D}!key@{key}}
\index{key@{key}!nntrainer::props::Padding2D@{nntrainer::props::Padding2D}}
\doxysubsubsection{\texorpdfstring{key}{key}}
{\footnotesize\ttfamily constexpr const char$\ast$ nntrainer\+::props\+::\+Padding2\+D\+::key = \char`\"{}padding\char`\"{}\hspace{0.3cm}{\ttfamily [static]}, {\ttfamily [constexpr]}}

unique key to access 

Definition at line 412 of file common\+\_\+properties.\+h.



The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
\item 
layers/\mbox{\hyperlink{common__properties_8h}{common\+\_\+properties.\+h}}\item 
layers/\mbox{\hyperlink{common__properties_8cpp}{common\+\_\+properties.\+cpp}}\end{DoxyCompactItemize}
