\hypertarget{classnntrainer_1_1InitLayerContext}{}\doxysection{nntrainer\+::Init\+Layer\+Context Class Reference}
\label{classnntrainer_1_1InitLayerContext}\index{nntrainer::InitLayerContext@{nntrainer::InitLayerContext}}
\doxysubsection*{Public Types}
\begin{DoxyCompactItemize}
\item 
typedef \mbox{\hyperlink{namespacenntrainer_acb044356c97403667b8eaf26179baf9c}{Var\+Grad\+Spec}} \mbox{\hyperlink{classnntrainer_1_1InitLayerContext_a486a7de8c8d7b030fdb3df84c7c8844d}{Tensor\+Spec}}
\begin{DoxyCompactList}\small\item\em Specification of the tensors. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{classnntrainer_1_1InitLayerContext_ab82c8943cbc53aa25311b9606f8dd3f8}{Init\+Layer\+Context}} (const std\+::vector$<$ Tensor\+Dim $>$ \&dim, const std\+::vector$<$ bool $>$ \&req\+\_\+out\+\_\+connected, bool in\+\_\+place\+\_\+, const std\+::string \&n=\char`\"{}\char`\"{}, const std\+::string \&prefix\+\_\+=\char`\"{}\char`\"{}, const float max\+\_\+norm=0.\+0)
\begin{DoxyCompactList}\small\item\em Construct a new Init \mbox{\hyperlink{classLayer}{Layer}} Context object. \end{DoxyCompactList}\item 
const std\+::string \& \mbox{\hyperlink{classnntrainer_1_1InitLayerContext_a28938506a13b848d3167b4da5c2930b0}{get\+Name}} () const
\begin{DoxyCompactList}\small\item\em get name by the layer \end{DoxyCompactList}\item 
unsigned int \mbox{\hyperlink{classnntrainer_1_1InitLayerContext_a9e0ae0f32480db410f9151bdf04225b5}{get\+Num\+Inputs}} () const
\begin{DoxyCompactList}\small\item\em Get the number of inputs for the layer. \end{DoxyCompactList}\item 
unsigned int \mbox{\hyperlink{classnntrainer_1_1InitLayerContext_a312ed1005ad72a284434afdbc5819e00}{get\+Num\+Requested\+Outputs}} () const
\begin{DoxyCompactList}\small\item\em Get the number of requested outputs for the layer. \end{DoxyCompactList}\item 
const std\+::vector$<$ Tensor\+Dim $>$ \& \mbox{\hyperlink{classnntrainer_1_1InitLayerContext_ac4d18665371b51a0acc2b98a24a8e307}{get\+Input\+Dimensions}} () const
\begin{DoxyCompactList}\small\item\em Get the Input Dimensions object. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classnntrainer_1_1InitLayerContext_a9f4caed8c241d4a8b6f7365ad31ecc93}{set\+Eff\+Dim\+Flag\+Input\+Dimension}} (unsigned int idx, const std\+::bitset$<$ Tensor\+Dim\+::\+M\+A\+X\+D\+IM $>$ \&dim\+\_\+flag\+\_\+)
\begin{DoxyCompactList}\small\item\em Set the Dim Flag to retrieve effective dimension. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classnntrainer_1_1InitLayerContext_a87b4a10d724cd86ddf71657138425e8d}{set\+Dyn\+Dim\+Flag\+Input\+Dimension}} (unsigned int idx, const std\+::bitset$<$ Tensor\+Dim\+::\+M\+A\+X\+D\+IM $>$ \&dim\+\_\+flag\+\_\+)
\begin{DoxyCompactList}\small\item\em Set the dynamic Dim Flag to retrieve dynamic dimension (that can change during running) \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classnntrainer_1_1InitLayerContext_a4fcbfddd2e9f89f589db133d8758aa73}{set\+Output\+Dimensions}} (const std\+::vector$<$ Tensor\+Dim $>$ \&out\+\_\+dim)
\begin{DoxyCompactList}\small\item\em Set the Output Dimensions object. \end{DoxyCompactList}\item 
unsigned int \mbox{\hyperlink{classnntrainer_1_1InitLayerContext_aa5fe2bb148fe39afffe99ddc5a28e834}{request\+Weight}} (const Tensor\+Dim \&dim, const Tensor\+::\+Initializer init, const \mbox{\hyperlink{namespacenntrainer_a9b456193e005bc14834eb1ecc03a7d58}{Weight\+Regularizer}} reg, const float reg\+\_\+const, const float decay, const std\+::string \&name, bool trainable=true)
\begin{DoxyCompactList}\small\item\em Request a new weight for the layer. \end{DoxyCompactList}\item 
unsigned int \mbox{\hyperlink{classnntrainer_1_1InitLayerContext_aac595bb42ee3ea96e6d83cfeb9b9cfc5}{request\+Weight}} (const \mbox{\hyperlink{namespacenntrainer_a486fa79107b2f54f85fd24a6e76a75dc}{Weight\+Spec}} \&spec)
\begin{DoxyCompactList}\small\item\em Request a new weight for the layer. \end{DoxyCompactList}\item 
unsigned int \mbox{\hyperlink{classnntrainer_1_1InitLayerContext_a2281f458a9b5e1c37488c6320c34dcb4}{request\+Tensor}} (const Tensor\+Dim \&dim, const std\+::string \&name, const Tensor\+::\+Initializer init=Tensor\+::\+Initializer\+::\+N\+O\+NE, bool trainable=false, \mbox{\hyperlink{namespacenntrainer_a7bd666a3854202ea94feb44a15ad622d}{Tensor\+Lifespan}} lifespan=\mbox{\hyperlink{namespacenntrainer_a7bd666a3854202ea94feb44a15ad622da3f7a0f4f9399f0d9ec0d8d26ec59e9ec}{Tensor\+Lifespan\+::\+I\+T\+E\+R\+A\+T\+I\+O\+N\+\_\+\+L\+I\+F\+E\+S\+P\+AN}}, bool private\+\_\+=true)
\begin{DoxyCompactList}\small\item\em Request a new tensor for the layer. \end{DoxyCompactList}\item 
unsigned int \mbox{\hyperlink{classnntrainer_1_1InitLayerContext_a6e9d822912f1f19078e03e44511e7e56}{request\+Tensor}} (const \mbox{\hyperlink{classnntrainer_1_1InitLayerContext_a486a7de8c8d7b030fdb3df84c7c8844d}{Tensor\+Spec}} \&spec)
\begin{DoxyCompactList}\small\item\em Request a new tensor for the layer. \end{DoxyCompactList}\item 
const std\+::vector$<$ \mbox{\hyperlink{namespacenntrainer_a486fa79107b2f54f85fd24a6e76a75dc}{Weight\+Spec}} $>$ \& \mbox{\hyperlink{classnntrainer_1_1InitLayerContext_a41776ae239c3233b835957aec9c7aaf6}{get\+Weights\+Spec}} () const
\begin{DoxyCompactList}\small\item\em Get the current weights spec. \end{DoxyCompactList}\item 
unsigned int \mbox{\hyperlink{classnntrainer_1_1InitLayerContext_a50085892615e3b58abb9e1fc8be5ed93}{get\+Num\+Weights}} () const
\begin{DoxyCompactList}\small\item\em Get the number of requested weights. \end{DoxyCompactList}\item 
const std\+::vector$<$ \mbox{\hyperlink{classnntrainer_1_1InitLayerContext_a486a7de8c8d7b030fdb3df84c7c8844d}{Tensor\+Spec}} $>$ \& \mbox{\hyperlink{classnntrainer_1_1InitLayerContext_a01149aa32d1e38dce1936ff0aaa300fd}{get\+Tensors\+Spec}} () const
\begin{DoxyCompactList}\small\item\em Get the current tensors spec. \end{DoxyCompactList}\item 
unsigned int \mbox{\hyperlink{classnntrainer_1_1InitLayerContext_a6c42b3931eca19f5b79fc37576232e48}{get\+Num\+Tensors}} () const
\begin{DoxyCompactList}\small\item\em Get the number of requested tensors objects. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classnntrainer_1_1InitLayerContext_a2231fd8d2b06023841b0560684980863}{request\+Outputs}} (std\+::vector$<$ \mbox{\hyperlink{structnntrainer_1_1VarGradSpecV2}{Var\+Grad\+Spec\+V2}} $>$ \&\&out\+\_\+specs)
\begin{DoxyCompactList}\small\item\em request outputs \end{DoxyCompactList}\item 
const std\+::vector$<$ \mbox{\hyperlink{structnntrainer_1_1VarGradSpecV2}{Var\+Grad\+Spec\+V2}} $>$ \& \mbox{\hyperlink{classnntrainer_1_1InitLayerContext_a85e5948e6d72bf7b801e81d12d355360}{get\+Out\+Specs}} () const
\begin{DoxyCompactList}\small\item\em Get the Out Specs object. \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{classnntrainer_1_1InitLayerContext_a1c67efa1560a9a5f4709301be2b938a1}{validate}} ()
\begin{DoxyCompactList}\small\item\em Validate the context. \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{classnntrainer_1_1InitLayerContext_ad4aef40932b369b01063be10fd3600fe}{execute\+In\+Place}} () const
\begin{DoxyCompactList}\small\item\em check if the layer is expected to run in-\/place \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
static \mbox{\hyperlink{structnntrainer_1_1VarGradSpecV2}{Var\+Grad\+Spec\+V2}} \mbox{\hyperlink{classnntrainer_1_1InitLayerContext_a74a5b6c748e7466e7b2469cc2ec11966}{out\+Spec}} (const Tensor\+Dim \&dim, const std\+::string \&name=\char`\"{}out\char`\"{}, Tensor\+Lifespan ls=\mbox{\hyperlink{namespacenntrainer_a7bd666a3854202ea94feb44a15ad622da6f193735a1915532364db08ff2406a34}{Tensor\+Lifespan\+::\+F\+O\+R\+W\+A\+R\+D\+\_\+\+F\+U\+N\+C\+\_\+\+L\+I\+F\+E\+S\+P\+AN}}, \mbox{\hyperlink{namespacenntrainer_a7bd666a3854202ea94feb44a15ad622d}{Tensor\+Lifespan}} grad\+\_\+ls=\mbox{\hyperlink{namespacenntrainer_a7bd666a3854202ea94feb44a15ad622da3a00727a27a5b578218b85d2f7085f95}{Tensor\+Lifespan\+::\+C\+A\+L\+C\+\_\+\+G\+R\+A\+D\+\_\+\+D\+E\+R\+I\+V\+\_\+\+L\+I\+F\+E\+S\+P\+AN}})
\begin{DoxyCompactList}\small\item\em create var grad specification with output default \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}


Definition at line 38 of file layer\+\_\+context.\+h.



\doxysubsection{Member Typedef Documentation}
\mbox{\Hypertarget{classnntrainer_1_1InitLayerContext_a486a7de8c8d7b030fdb3df84c7c8844d}\label{classnntrainer_1_1InitLayerContext_a486a7de8c8d7b030fdb3df84c7c8844d}} 
\index{nntrainer::InitLayerContext@{nntrainer::InitLayerContext}!TensorSpec@{TensorSpec}}
\index{TensorSpec@{TensorSpec}!nntrainer::InitLayerContext@{nntrainer::InitLayerContext}}
\doxysubsubsection{\texorpdfstring{TensorSpec}{TensorSpec}}
{\footnotesize\ttfamily typedef \mbox{\hyperlink{namespacenntrainer_acb044356c97403667b8eaf26179baf9c}{Var\+Grad\+Spec}} \mbox{\hyperlink{classnntrainer_1_1InitLayerContext_a486a7de8c8d7b030fdb3df84c7c8844d}{nntrainer\+::\+Init\+Layer\+Context\+::\+Tensor\+Spec}}}



Specification of the tensors. 



Definition at line 182 of file layer\+\_\+context.\+h.



\doxysubsection{Constructor \& Destructor Documentation}
\mbox{\Hypertarget{classnntrainer_1_1InitLayerContext_ab82c8943cbc53aa25311b9606f8dd3f8}\label{classnntrainer_1_1InitLayerContext_ab82c8943cbc53aa25311b9606f8dd3f8}} 
\index{nntrainer::InitLayerContext@{nntrainer::InitLayerContext}!InitLayerContext@{InitLayerContext}}
\index{InitLayerContext@{InitLayerContext}!nntrainer::InitLayerContext@{nntrainer::InitLayerContext}}
\doxysubsubsection{\texorpdfstring{InitLayerContext()}{InitLayerContext()}}
{\footnotesize\ttfamily nntrainer\+::\+Init\+Layer\+Context\+::\+Init\+Layer\+Context (\begin{DoxyParamCaption}\item[{const std\+::vector$<$ Tensor\+Dim $>$ \&}]{dim,  }\item[{const std\+::vector$<$ bool $>$ \&}]{req\+\_\+out\+\_\+connected,  }\item[{bool}]{in\+\_\+place\+\_\+,  }\item[{const std\+::string \&}]{n = {\ttfamily \char`\"{}\char`\"{}},  }\item[{const std\+::string \&}]{prefix\+\_\+ = {\ttfamily \char`\"{}\char`\"{}},  }\item[{const float}]{max\+\_\+norm = {\ttfamily 0.0} }\end{DoxyParamCaption})}



Construct a new Init \mbox{\hyperlink{classLayer}{Layer}} Context object. 


\begin{DoxyParams}{Parameters}
{\em dim} & Input dimensions for the layer \\
\hline
{\em req\+\_\+out\+\_\+connected} & bool vector to tell if requested output is trainable or not \\
\hline
{\em in\+\_\+place\+\_\+} & true if the context is inplacable \\
\hline
{\em name} & name \\
\hline
{\em prefix\+\_\+} & prefix \\
\hline
{\em max\+\_\+norm} & max norm \\
\hline
\end{DoxyParams}


Definition at line 40 of file layer\+\_\+context.\+cpp.



\doxysubsection{Member Function Documentation}
\mbox{\Hypertarget{classnntrainer_1_1InitLayerContext_ad4aef40932b369b01063be10fd3600fe}\label{classnntrainer_1_1InitLayerContext_ad4aef40932b369b01063be10fd3600fe}} 
\index{nntrainer::InitLayerContext@{nntrainer::InitLayerContext}!executeInPlace@{executeInPlace}}
\index{executeInPlace@{executeInPlace}!nntrainer::InitLayerContext@{nntrainer::InitLayerContext}}
\doxysubsubsection{\texorpdfstring{executeInPlace()}{executeInPlace()}}
{\footnotesize\ttfamily bool nntrainer\+::\+Init\+Layer\+Context\+::execute\+In\+Place (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



check if the layer is expected to run in-\/place 

\begin{DoxyReturn}{Returns}
true if in-\/place, else false 
\end{DoxyReturn}


Definition at line 284 of file layer\+\_\+context.\+h.

\mbox{\Hypertarget{classnntrainer_1_1InitLayerContext_ac4d18665371b51a0acc2b98a24a8e307}\label{classnntrainer_1_1InitLayerContext_ac4d18665371b51a0acc2b98a24a8e307}} 
\index{nntrainer::InitLayerContext@{nntrainer::InitLayerContext}!getInputDimensions@{getInputDimensions}}
\index{getInputDimensions@{getInputDimensions}!nntrainer::InitLayerContext@{nntrainer::InitLayerContext}}
\doxysubsubsection{\texorpdfstring{getInputDimensions()}{getInputDimensions()}}
{\footnotesize\ttfamily const std\+::vector$<$Tensor\+Dim$>$\& nntrainer\+::\+Init\+Layer\+Context\+::get\+Input\+Dimensions (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get the Input Dimensions object. 

\begin{DoxyReturn}{Returns}
const std\+::vector$<$\+Tensor\+Dim$>$\& Input dimensions 
\end{DoxyReturn}


Definition at line 82 of file layer\+\_\+context.\+h.

Here is the caller graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classnntrainer_1_1InitLayerContext_ac4d18665371b51a0acc2b98a24a8e307_icgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{classnntrainer_1_1InitLayerContext_a28938506a13b848d3167b4da5c2930b0}\label{classnntrainer_1_1InitLayerContext_a28938506a13b848d3167b4da5c2930b0}} 
\index{nntrainer::InitLayerContext@{nntrainer::InitLayerContext}!getName@{getName}}
\index{getName@{getName}!nntrainer::InitLayerContext@{nntrainer::InitLayerContext}}
\doxysubsubsection{\texorpdfstring{getName()}{getName()}}
{\footnotesize\ttfamily const std\+::string\& nntrainer\+::\+Init\+Layer\+Context\+::get\+Name (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



get name by the layer 

\begin{DoxyReturn}{Returns}
name of the layer 
\end{DoxyReturn}


Definition at line 61 of file layer\+\_\+context.\+h.

\mbox{\Hypertarget{classnntrainer_1_1InitLayerContext_a9e0ae0f32480db410f9151bdf04225b5}\label{classnntrainer_1_1InitLayerContext_a9e0ae0f32480db410f9151bdf04225b5}} 
\index{nntrainer::InitLayerContext@{nntrainer::InitLayerContext}!getNumInputs@{getNumInputs}}
\index{getNumInputs@{getNumInputs}!nntrainer::InitLayerContext@{nntrainer::InitLayerContext}}
\doxysubsubsection{\texorpdfstring{getNumInputs()}{getNumInputs()}}
{\footnotesize\ttfamily unsigned int nntrainer\+::\+Init\+Layer\+Context\+::get\+Num\+Inputs (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get the number of inputs for the layer. 

\begin{DoxyReturn}{Returns}
unsigned int number of inputs 
\end{DoxyReturn}


Definition at line 68 of file layer\+\_\+context.\+h.

\mbox{\Hypertarget{classnntrainer_1_1InitLayerContext_a312ed1005ad72a284434afdbc5819e00}\label{classnntrainer_1_1InitLayerContext_a312ed1005ad72a284434afdbc5819e00}} 
\index{nntrainer::InitLayerContext@{nntrainer::InitLayerContext}!getNumRequestedOutputs@{getNumRequestedOutputs}}
\index{getNumRequestedOutputs@{getNumRequestedOutputs}!nntrainer::InitLayerContext@{nntrainer::InitLayerContext}}
\doxysubsubsection{\texorpdfstring{getNumRequestedOutputs()}{getNumRequestedOutputs()}}
{\footnotesize\ttfamily unsigned int nntrainer\+::\+Init\+Layer\+Context\+::get\+Num\+Requested\+Outputs (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const}



Get the number of requested outputs for the layer. 

\begin{DoxyReturn}{Returns}
unsigned int number of requested outputs 
\end{DoxyReturn}


Definition at line 59 of file layer\+\_\+context.\+cpp.

\mbox{\Hypertarget{classnntrainer_1_1InitLayerContext_a6c42b3931eca19f5b79fc37576232e48}\label{classnntrainer_1_1InitLayerContext_a6c42b3931eca19f5b79fc37576232e48}} 
\index{nntrainer::InitLayerContext@{nntrainer::InitLayerContext}!getNumTensors@{getNumTensors}}
\index{getNumTensors@{getNumTensors}!nntrainer::InitLayerContext@{nntrainer::InitLayerContext}}
\doxysubsubsection{\texorpdfstring{getNumTensors()}{getNumTensors()}}
{\footnotesize\ttfamily unsigned int nntrainer\+::\+Init\+Layer\+Context\+::get\+Num\+Tensors (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get the number of requested tensors objects. 

\begin{DoxyReturn}{Returns}
unsigned int number of requested tensors 
\end{DoxyReturn}


Definition at line 224 of file layer\+\_\+context.\+h.

\mbox{\Hypertarget{classnntrainer_1_1InitLayerContext_a50085892615e3b58abb9e1fc8be5ed93}\label{classnntrainer_1_1InitLayerContext_a50085892615e3b58abb9e1fc8be5ed93}} 
\index{nntrainer::InitLayerContext@{nntrainer::InitLayerContext}!getNumWeights@{getNumWeights}}
\index{getNumWeights@{getNumWeights}!nntrainer::InitLayerContext@{nntrainer::InitLayerContext}}
\doxysubsubsection{\texorpdfstring{getNumWeights()}{getNumWeights()}}
{\footnotesize\ttfamily unsigned int nntrainer\+::\+Init\+Layer\+Context\+::get\+Num\+Weights (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get the number of requested weights. 

\begin{DoxyReturn}{Returns}
The current number of requested weights 
\end{DoxyReturn}


Definition at line 210 of file layer\+\_\+context.\+h.

\mbox{\Hypertarget{classnntrainer_1_1InitLayerContext_a85e5948e6d72bf7b801e81d12d355360}\label{classnntrainer_1_1InitLayerContext_a85e5948e6d72bf7b801e81d12d355360}} 
\index{nntrainer::InitLayerContext@{nntrainer::InitLayerContext}!getOutSpecs@{getOutSpecs}}
\index{getOutSpecs@{getOutSpecs}!nntrainer::InitLayerContext@{nntrainer::InitLayerContext}}
\doxysubsubsection{\texorpdfstring{getOutSpecs()}{getOutSpecs()}}
{\footnotesize\ttfamily const std\+::vector$<$ \mbox{\hyperlink{structnntrainer_1_1VarGradSpecV2}{Var\+Grad\+Spec\+V2}} $>$ \& nntrainer\+::\+Init\+Layer\+Context\+::get\+Out\+Specs (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const}



Get the Out Specs object. 

\begin{DoxyReturn}{Returns}
std\+::vector$<$\+Var\+Grad\+Spec\+V2$>$ out specification 
\end{DoxyReturn}


Definition at line 118 of file layer\+\_\+context.\+cpp.

\mbox{\Hypertarget{classnntrainer_1_1InitLayerContext_a01149aa32d1e38dce1936ff0aaa300fd}\label{classnntrainer_1_1InitLayerContext_a01149aa32d1e38dce1936ff0aaa300fd}} 
\index{nntrainer::InitLayerContext@{nntrainer::InitLayerContext}!getTensorsSpec@{getTensorsSpec}}
\index{getTensorsSpec@{getTensorsSpec}!nntrainer::InitLayerContext@{nntrainer::InitLayerContext}}
\doxysubsubsection{\texorpdfstring{getTensorsSpec()}{getTensorsSpec()}}
{\footnotesize\ttfamily const std\+::vector$<$\mbox{\hyperlink{classnntrainer_1_1InitLayerContext_a486a7de8c8d7b030fdb3df84c7c8844d}{Tensor\+Spec}}$>$\& nntrainer\+::\+Init\+Layer\+Context\+::get\+Tensors\+Spec (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get the current tensors spec. 

\begin{DoxyReturn}{Returns}
The current tensors spec 
\end{DoxyReturn}


Definition at line 217 of file layer\+\_\+context.\+h.

\mbox{\Hypertarget{classnntrainer_1_1InitLayerContext_a41776ae239c3233b835957aec9c7aaf6}\label{classnntrainer_1_1InitLayerContext_a41776ae239c3233b835957aec9c7aaf6}} 
\index{nntrainer::InitLayerContext@{nntrainer::InitLayerContext}!getWeightsSpec@{getWeightsSpec}}
\index{getWeightsSpec@{getWeightsSpec}!nntrainer::InitLayerContext@{nntrainer::InitLayerContext}}
\doxysubsubsection{\texorpdfstring{getWeightsSpec()}{getWeightsSpec()}}
{\footnotesize\ttfamily const std\+::vector$<$\mbox{\hyperlink{namespacenntrainer_a486fa79107b2f54f85fd24a6e76a75dc}{Weight\+Spec}}$>$\& nntrainer\+::\+Init\+Layer\+Context\+::get\+Weights\+Spec (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get the current weights spec. 

\begin{DoxyReturn}{Returns}
The current weights spec 
\end{DoxyReturn}


Definition at line 203 of file layer\+\_\+context.\+h.

\mbox{\Hypertarget{classnntrainer_1_1InitLayerContext_a74a5b6c748e7466e7b2469cc2ec11966}\label{classnntrainer_1_1InitLayerContext_a74a5b6c748e7466e7b2469cc2ec11966}} 
\index{nntrainer::InitLayerContext@{nntrainer::InitLayerContext}!outSpec@{outSpec}}
\index{outSpec@{outSpec}!nntrainer::InitLayerContext@{nntrainer::InitLayerContext}}
\doxysubsubsection{\texorpdfstring{outSpec()}{outSpec()}}
{\footnotesize\ttfamily \mbox{\hyperlink{structnntrainer_1_1VarGradSpecV2}{Var\+Grad\+Spec\+V2}} nntrainer\+::\+Init\+Layer\+Context\+::out\+Spec (\begin{DoxyParamCaption}\item[{const Tensor\+Dim \&}]{dim,  }\item[{const std\+::string \&}]{name = {\ttfamily \char`\"{}out\char`\"{}},  }\item[{\mbox{\hyperlink{namespacenntrainer_a7bd666a3854202ea94feb44a15ad622d}{Tensor\+Lifespan}}}]{ls = {\ttfamily \mbox{\hyperlink{namespacenntrainer_a7bd666a3854202ea94feb44a15ad622da6f193735a1915532364db08ff2406a34}{Tensor\+Lifespan\+::\+F\+O\+R\+W\+A\+R\+D\+\_\+\+F\+U\+N\+C\+\_\+\+L\+I\+F\+E\+S\+P\+AN}}},  }\item[{\mbox{\hyperlink{namespacenntrainer_a7bd666a3854202ea94feb44a15ad622d}{Tensor\+Lifespan}}}]{grad\+\_\+ls = {\ttfamily \mbox{\hyperlink{namespacenntrainer_a7bd666a3854202ea94feb44a15ad622da3a00727a27a5b578218b85d2f7085f95}{Tensor\+Lifespan\+::\+C\+A\+L\+C\+\_\+\+G\+R\+A\+D\+\_\+\+D\+E\+R\+I\+V\+\_\+\+L\+I\+F\+E\+S\+P\+AN}}} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



create var grad specification with output default 


\begin{DoxyParams}{Parameters}
{\em dim} & dimension \\
\hline
{\em name} & name \\
\hline
{\em ls} & variable lifespan \\
\hline
{\em grad\+\_\+ls} & gradient lifespan \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
\mbox{\hyperlink{structnntrainer_1_1VarGradSpecV2}{Var\+Grad\+Spec\+V2}} var grad specification 
\end{DoxyReturn}


Definition at line 76 of file layer\+\_\+context.\+cpp.

Here is the caller graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classnntrainer_1_1InitLayerContext_a74a5b6c748e7466e7b2469cc2ec11966_icgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{classnntrainer_1_1InitLayerContext_a2231fd8d2b06023841b0560684980863}\label{classnntrainer_1_1InitLayerContext_a2231fd8d2b06023841b0560684980863}} 
\index{nntrainer::InitLayerContext@{nntrainer::InitLayerContext}!requestOutputs@{requestOutputs}}
\index{requestOutputs@{requestOutputs}!nntrainer::InitLayerContext@{nntrainer::InitLayerContext}}
\doxysubsubsection{\texorpdfstring{requestOutputs()}{requestOutputs()}}
{\footnotesize\ttfamily void nntrainer\+::\+Init\+Layer\+Context\+::request\+Outputs (\begin{DoxyParamCaption}\item[{std\+::vector$<$ \mbox{\hyperlink{structnntrainer_1_1VarGradSpecV2}{Var\+Grad\+Spec\+V2}} $>$ \&\&}]{out\+\_\+specs }\end{DoxyParamCaption})}



request outputs 


\begin{DoxyParams}{Parameters}
{\em out\+\_\+specs} & pack of out specification, name will be automatically indexed to prevent name clash \\
\hline
\end{DoxyParams}


Definition at line 90 of file layer\+\_\+context.\+cpp.

Here is the caller graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classnntrainer_1_1InitLayerContext_a2231fd8d2b06023841b0560684980863_icgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{classnntrainer_1_1InitLayerContext_a2281f458a9b5e1c37488c6320c34dcb4}\label{classnntrainer_1_1InitLayerContext_a2281f458a9b5e1c37488c6320c34dcb4}} 
\index{nntrainer::InitLayerContext@{nntrainer::InitLayerContext}!requestTensor@{requestTensor}}
\index{requestTensor@{requestTensor}!nntrainer::InitLayerContext@{nntrainer::InitLayerContext}}
\doxysubsubsection{\texorpdfstring{requestTensor()}{requestTensor()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily unsigned int nntrainer\+::\+Init\+Layer\+Context\+::request\+Tensor (\begin{DoxyParamCaption}\item[{const Tensor\+Dim \&}]{dim,  }\item[{const std\+::string \&}]{name,  }\item[{const Tensor\+::\+Initializer}]{init = {\ttfamily Tensor\+:\+:Initializer\+:\+:NONE},  }\item[{bool}]{trainable = {\ttfamily false},  }\item[{\mbox{\hyperlink{namespacenntrainer_a7bd666a3854202ea94feb44a15ad622d}{Tensor\+Lifespan}}}]{lifespan = {\ttfamily \mbox{\hyperlink{namespacenntrainer_a7bd666a3854202ea94feb44a15ad622da3f7a0f4f9399f0d9ec0d8d26ec59e9ec}{Tensor\+Lifespan\+::\+I\+T\+E\+R\+A\+T\+I\+O\+N\+\_\+\+L\+I\+F\+E\+S\+P\+AN}}},  }\item[{bool}]{private\+\_\+ = {\ttfamily true} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Request a new tensor for the layer. 


\begin{DoxyParams}{Parameters}
{\em dim} & dimension of the tensor \\
\hline
{\em trainable} & if the tensor is trainable (require gradient or not) \\
\hline
{\em name} & name of the tensor \\
\hline
{\em lifespan} & lifespan of the tensor \\
\hline
{\em private\+\_\+} & if custom tensor should not be shared, and only for soleuse \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
unsigned int index of the tensor for its getter
\end{DoxyReturn}
\begin{DoxyRefDesc}{Todo}
\item[\mbox{\hyperlink{todo__todo000072}{Todo}}]Consider providing a guarantee that the returned indices will always start from 0 and will always be incremental. \end{DoxyRefDesc}


Definition at line 167 of file layer\+\_\+context.\+h.

\mbox{\Hypertarget{classnntrainer_1_1InitLayerContext_a6e9d822912f1f19078e03e44511e7e56}\label{classnntrainer_1_1InitLayerContext_a6e9d822912f1f19078e03e44511e7e56}} 
\index{nntrainer::InitLayerContext@{nntrainer::InitLayerContext}!requestTensor@{requestTensor}}
\index{requestTensor@{requestTensor}!nntrainer::InitLayerContext@{nntrainer::InitLayerContext}}
\doxysubsubsection{\texorpdfstring{requestTensor()}{requestTensor()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily unsigned int nntrainer\+::\+Init\+Layer\+Context\+::request\+Tensor (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{classnntrainer_1_1InitLayerContext_a486a7de8c8d7b030fdb3df84c7c8844d}{Tensor\+Spec}} \&}]{spec }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Request a new tensor for the layer. 


\begin{DoxyParams}{Parameters}
{\em spec} & tensor spec \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
unsigned int index of the tensor for its getter
\end{DoxyReturn}
\begin{DoxyRefDesc}{Todo}
\item[\mbox{\hyperlink{todo__todo000073}{Todo}}]Consider providing a guarantee that the returned indices will always start from 0 and will always be incremental. \end{DoxyRefDesc}


Definition at line 193 of file layer\+\_\+context.\+h.

\mbox{\Hypertarget{classnntrainer_1_1InitLayerContext_aa5fe2bb148fe39afffe99ddc5a28e834}\label{classnntrainer_1_1InitLayerContext_aa5fe2bb148fe39afffe99ddc5a28e834}} 
\index{nntrainer::InitLayerContext@{nntrainer::InitLayerContext}!requestWeight@{requestWeight}}
\index{requestWeight@{requestWeight}!nntrainer::InitLayerContext@{nntrainer::InitLayerContext}}
\doxysubsubsection{\texorpdfstring{requestWeight()}{requestWeight()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily unsigned int nntrainer\+::\+Init\+Layer\+Context\+::request\+Weight (\begin{DoxyParamCaption}\item[{const Tensor\+Dim \&}]{dim,  }\item[{const Tensor\+::\+Initializer}]{init,  }\item[{const \mbox{\hyperlink{namespacenntrainer_a9b456193e005bc14834eb1ecc03a7d58}{Weight\+Regularizer}}}]{reg,  }\item[{const float}]{reg\+\_\+const,  }\item[{const float}]{decay,  }\item[{const std\+::string \&}]{name,  }\item[{bool}]{trainable = {\ttfamily true} }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Request a new weight for the layer. 


\begin{DoxyParams}{Parameters}
{\em dim} & dimension of the weight \\
\hline
{\em init} & initializer for the weight \\
\hline
{\em reg} & regularizer for the weight \\
\hline
{\em reg\+\_\+const} & regularization constant for the weight \\
\hline
{\em name} & name of the weight \\
\hline
{\em trainable} & if the weight is trainable (require gradient or not) \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
unsigned int index of the weight for its getter
\end{DoxyReturn}
\begin{DoxyRefDesc}{Todo}
\item[\mbox{\hyperlink{todo__todo000070}{Todo}}]Consider providing a guarantee that the returned indices will always start from 0 and will always be incremental. \end{DoxyRefDesc}


Definition at line 128 of file layer\+\_\+context.\+h.

\mbox{\Hypertarget{classnntrainer_1_1InitLayerContext_aac595bb42ee3ea96e6d83cfeb9b9cfc5}\label{classnntrainer_1_1InitLayerContext_aac595bb42ee3ea96e6d83cfeb9b9cfc5}} 
\index{nntrainer::InitLayerContext@{nntrainer::InitLayerContext}!requestWeight@{requestWeight}}
\index{requestWeight@{requestWeight}!nntrainer::InitLayerContext@{nntrainer::InitLayerContext}}
\doxysubsubsection{\texorpdfstring{requestWeight()}{requestWeight()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily unsigned int nntrainer\+::\+Init\+Layer\+Context\+::request\+Weight (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{namespacenntrainer_a486fa79107b2f54f85fd24a6e76a75dc}{Weight\+Spec}} \&}]{spec }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Request a new weight for the layer. 


\begin{DoxyParams}{Parameters}
{\em spec} & tensor spec \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
unsigned int index of the weight for its getter
\end{DoxyReturn}
\begin{DoxyRefDesc}{Todo}
\item[\mbox{\hyperlink{todo__todo000071}{Todo}}]Consider providing a guarantee that the returned indices will always start from 0 and will always be incremental. \end{DoxyRefDesc}


Definition at line 148 of file layer\+\_\+context.\+h.

\mbox{\Hypertarget{classnntrainer_1_1InitLayerContext_a87b4a10d724cd86ddf71657138425e8d}\label{classnntrainer_1_1InitLayerContext_a87b4a10d724cd86ddf71657138425e8d}} 
\index{nntrainer::InitLayerContext@{nntrainer::InitLayerContext}!setDynDimFlagInputDimension@{setDynDimFlagInputDimension}}
\index{setDynDimFlagInputDimension@{setDynDimFlagInputDimension}!nntrainer::InitLayerContext@{nntrainer::InitLayerContext}}
\doxysubsubsection{\texorpdfstring{setDynDimFlagInputDimension()}{setDynDimFlagInputDimension()}}
{\footnotesize\ttfamily void nntrainer\+::\+Init\+Layer\+Context\+::set\+Dyn\+Dim\+Flag\+Input\+Dimension (\begin{DoxyParamCaption}\item[{unsigned int}]{idx,  }\item[{const std\+::bitset$<$ Tensor\+Dim\+::\+M\+A\+X\+D\+IM $>$ \&}]{dim\+\_\+flag\+\_\+ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Set the dynamic Dim Flag to retrieve dynamic dimension (that can change during running) 


\begin{DoxyParams}{Parameters}
{\em dim\+\_\+flag\+\_\+} & dimension bit to calculate, rightmost is width \\
\hline
\end{DoxyParams}


Definition at line 102 of file layer\+\_\+context.\+h.

\mbox{\Hypertarget{classnntrainer_1_1InitLayerContext_a9f4caed8c241d4a8b6f7365ad31ecc93}\label{classnntrainer_1_1InitLayerContext_a9f4caed8c241d4a8b6f7365ad31ecc93}} 
\index{nntrainer::InitLayerContext@{nntrainer::InitLayerContext}!setEffDimFlagInputDimension@{setEffDimFlagInputDimension}}
\index{setEffDimFlagInputDimension@{setEffDimFlagInputDimension}!nntrainer::InitLayerContext@{nntrainer::InitLayerContext}}
\doxysubsubsection{\texorpdfstring{setEffDimFlagInputDimension()}{setEffDimFlagInputDimension()}}
{\footnotesize\ttfamily void nntrainer\+::\+Init\+Layer\+Context\+::set\+Eff\+Dim\+Flag\+Input\+Dimension (\begin{DoxyParamCaption}\item[{unsigned int}]{idx,  }\item[{const std\+::bitset$<$ Tensor\+Dim\+::\+M\+A\+X\+D\+IM $>$ \&}]{dim\+\_\+flag\+\_\+ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Set the Dim Flag to retrieve effective dimension. 


\begin{DoxyParams}{Parameters}
{\em dim\+\_\+flag\+\_\+} & dimension bit to calculate, rightmost is width \\
\hline
\end{DoxyParams}


Definition at line 90 of file layer\+\_\+context.\+h.

\mbox{\Hypertarget{classnntrainer_1_1InitLayerContext_a4fcbfddd2e9f89f589db133d8758aa73}\label{classnntrainer_1_1InitLayerContext_a4fcbfddd2e9f89f589db133d8758aa73}} 
\index{nntrainer::InitLayerContext@{nntrainer::InitLayerContext}!setOutputDimensions@{setOutputDimensions}}
\index{setOutputDimensions@{setOutputDimensions}!nntrainer::InitLayerContext@{nntrainer::InitLayerContext}}
\doxysubsubsection{\texorpdfstring{setOutputDimensions()}{setOutputDimensions()}}
{\footnotesize\ttfamily void nntrainer\+::\+Init\+Layer\+Context\+::set\+Output\+Dimensions (\begin{DoxyParamCaption}\item[{const std\+::vector$<$ Tensor\+Dim $>$ \&}]{out\+\_\+dim }\end{DoxyParamCaption})}



Set the Output Dimensions object. 


\begin{DoxyParams}{Parameters}
{\em out\+\_\+dim} & the output dimension to set to \\
\hline
\end{DoxyParams}


Definition at line 63 of file layer\+\_\+context.\+cpp.

Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classnntrainer_1_1InitLayerContext_a4fcbfddd2e9f89f589db133d8758aa73_cgraph}
\end{center}
\end{figure}
Here is the caller graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classnntrainer_1_1InitLayerContext_a4fcbfddd2e9f89f589db133d8758aa73_icgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{classnntrainer_1_1InitLayerContext_a1c67efa1560a9a5f4709301be2b938a1}\label{classnntrainer_1_1InitLayerContext_a1c67efa1560a9a5f4709301be2b938a1}} 
\index{nntrainer::InitLayerContext@{nntrainer::InitLayerContext}!validate@{validate}}
\index{validate@{validate}!nntrainer::InitLayerContext@{nntrainer::InitLayerContext}}
\doxysubsubsection{\texorpdfstring{validate()}{validate()}}
{\footnotesize\ttfamily bool nntrainer\+::\+Init\+Layer\+Context\+::validate (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Validate the context. 

\begin{DoxyReturn}{Returns}
true if validated, else false 
\end{DoxyReturn}
\begin{DoxyNote}{Note}
this must be called before passing a context to a layer for finalize 
\end{DoxyNote}


Definition at line 261 of file layer\+\_\+context.\+h.



The documentation for this class was generated from the following files\+:\begin{DoxyCompactItemize}
\item 
layers/\mbox{\hyperlink{layer__context_8h}{layer\+\_\+context.\+h}}\item 
layers/\mbox{\hyperlink{layer__context_8cpp}{layer\+\_\+context.\+cpp}}\end{DoxyCompactItemize}
