\hypertarget{classnntrainer_1_1RunLayerContext}{}\doxysection{nntrainer\+::Run\+Layer\+Context Class Reference}
\label{classnntrainer_1_1RunLayerContext}\index{nntrainer::RunLayerContext@{nntrainer::RunLayerContext}}
\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{classnntrainer_1_1RunLayerContext_a0d0a085d1d66dec386b2f21ec90f2f10}{Run\+Layer\+Context}} ()
\begin{DoxyCompactList}\small\item\em Construct a new Run \mbox{\hyperlink{classLayer}{Layer}} Context object. \end{DoxyCompactList}\item 
\mbox{\hyperlink{classnntrainer_1_1RunLayerContext_a9a33a7625cb327b97c1b7b80a2ef7bcc}{Run\+Layer\+Context}} (const std\+::string \&name, bool in\+\_\+place\+\_\+)
\begin{DoxyCompactList}\small\item\em Construct a new Run \mbox{\hyperlink{classLayer}{Layer}} Context object. \end{DoxyCompactList}\item 
\mbox{\hyperlink{classnntrainer_1_1RunLayerContext_aaa3af6a56b60296891625aeb56a21892}{Run\+Layer\+Context}} (const std\+::string \&name, bool trainable, float l, bool in\+\_\+place\+\_\+, const std\+::vector$<$ \mbox{\hyperlink{classnntrainer_1_1Weight}{Weight}} $\ast$ $>$ \&w, const std\+::vector$<$ \mbox{\hyperlink{classnntrainer_1_1Var__Grad}{Var\+\_\+\+Grad}} $\ast$ $>$ \&in, const std\+::vector$<$ \mbox{\hyperlink{classnntrainer_1_1Var__Grad}{Var\+\_\+\+Grad}} $\ast$ $>$ \&out, const std\+::vector$<$ \mbox{\hyperlink{classnntrainer_1_1Var__Grad}{Var\+\_\+\+Grad}} $\ast$ $>$ \&t)
\begin{DoxyCompactList}\small\item\em Construct a new Run \mbox{\hyperlink{classLayer}{Layer}} Context object. \end{DoxyCompactList}\item 
Tensor \& \mbox{\hyperlink{classnntrainer_1_1RunLayerContext_a11595345a129892ad63fd6dfc847a380}{get\+Weight}} (unsigned int idx) const
\begin{DoxyCompactList}\small\item\em Get the \mbox{\hyperlink{classnntrainer_1_1Weight}{Weight}} tensor object. \end{DoxyCompactList}\item 
Tensor \& \mbox{\hyperlink{classnntrainer_1_1RunLayerContext_a5d9340845433ecdb493e712681ed0df7}{get\+Weight\+Grad}} (unsigned int idx) const
\begin{DoxyCompactList}\small\item\em Get the \mbox{\hyperlink{classnntrainer_1_1Weight}{Weight}} Gradient tensor object. \end{DoxyCompactList}\item 
Tensor \& \mbox{\hyperlink{classnntrainer_1_1RunLayerContext_a2ffdfd438d5e6a9167ad9d854e17b274}{get\+Weight\+Opt\+Var}} (unsigned int idx, unsigned int jdx) const
\begin{DoxyCompactList}\small\item\em Get the \mbox{\hyperlink{classnntrainer_1_1Weight}{Weight}} Optimizer Variable tensor object. \end{DoxyCompactList}\item 
const std\+::string \& \mbox{\hyperlink{classnntrainer_1_1RunLayerContext_a935c2656d34f64ae429e8bb268e702d2}{get\+Weight\+Name}} (unsigned int idx) const
\begin{DoxyCompactList}\small\item\em Get the \mbox{\hyperlink{classnntrainer_1_1Weight}{Weight}} name. \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{classnntrainer_1_1RunLayerContext_abc5a61d5bc44827d6860324e2a30e8f1}{weight\+Has\+Gradient}} (unsigned int idx) const
\begin{DoxyCompactList}\small\item\em check if the weight has gradient \end{DoxyCompactList}\item 
Tensor \& \mbox{\hyperlink{classnntrainer_1_1RunLayerContext_a0a7775c31a49a29f550d8889fab653e5}{get\+Output}} (unsigned int idx)
\begin{DoxyCompactList}\small\item\em Get the Output tensor object. \end{DoxyCompactList}\item 
const Tensor \& \mbox{\hyperlink{classnntrainer_1_1RunLayerContext_ab57219afb1de23ec8c26dcaa4a15eaaa}{get\+Output}} (unsigned int idx) const
\begin{DoxyCompactList}\small\item\em Get the Output tensor object. \end{DoxyCompactList}\item 
const Tensor \mbox{\hyperlink{classnntrainer_1_1RunLayerContext_a327af7d7dc0262062bcc8cb97ca1d9e2}{get\+Output\+Grad}} (unsigned int idx) const
\begin{DoxyCompactList}\small\item\em Get the Output Grad tensor object. \end{DoxyCompactList}\item 
Tensor \& \mbox{\hyperlink{classnntrainer_1_1RunLayerContext_a5e772b4f30b2102a9aa9dc7a52a5e75f}{get\+Output\+Grad\+Unsafe}} (unsigned int idx)
\begin{DoxyCompactList}\small\item\em Get the Output Grad tensor object. \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{classnntrainer_1_1RunLayerContext_a86c370d449c2daf951fda2910347fa8e}{output\+Has\+Gradient}} (unsigned int idx) const
\begin{DoxyCompactList}\small\item\em check if the weight has gradient \end{DoxyCompactList}\item 
const Tensor \mbox{\hyperlink{classnntrainer_1_1RunLayerContext_af960325f54392b9d963ba3371e04a793}{get\+Incoming\+Derivative}} (unsigned int idx) const
\begin{DoxyCompactList}\small\item\em Get the incoming Derivative tensor object. \end{DoxyCompactList}\item 
Tensor \& \mbox{\hyperlink{classnntrainer_1_1RunLayerContext_a1df0ac37074287ffd4c0aec5b56ccdab}{get\+Input}} (unsigned int idx)
\begin{DoxyCompactList}\small\item\em Get the Input tensor object. \end{DoxyCompactList}\item 
const Tensor \& \mbox{\hyperlink{classnntrainer_1_1RunLayerContext_ae28599f9e17899bd3864c6a478f95268}{get\+Input}} (unsigned int idx) const
\begin{DoxyCompactList}\small\item\em Get the Input tensor object. \end{DoxyCompactList}\item 
Tensor \& \mbox{\hyperlink{classnntrainer_1_1RunLayerContext_ab32143d119bad58d8475401bc2c5d80c}{get\+Input\+Grad}} (unsigned int idx)
\begin{DoxyCompactList}\small\item\em Get the Input Grad tensor object. \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{classnntrainer_1_1RunLayerContext_a495b8f2664d455982f371d75884b98f3}{input\+Has\+Gradient}} (unsigned int idx) const
\begin{DoxyCompactList}\small\item\em check if the weight has gradient \end{DoxyCompactList}\item 
Tensor \& \mbox{\hyperlink{classnntrainer_1_1RunLayerContext_ad7980e5a12d15ba89f510f8c138ee30b}{get\+Outgoing\+Derivative}} (unsigned int idx)
\begin{DoxyCompactList}\small\item\em Get the outgoing Derivative tensor object. \end{DoxyCompactList}\item 
Tensor \& \mbox{\hyperlink{classnntrainer_1_1RunLayerContext_a76211b8d6caf1fbec9442c99918245e0}{get\+Tensor}} (unsigned int idx)
\begin{DoxyCompactList}\small\item\em Get the Tensor object. \end{DoxyCompactList}\item 
const Tensor \& \mbox{\hyperlink{classnntrainer_1_1RunLayerContext_a9286c41a4799b3a3a9c04c1b959ee392}{get\+Tensor}} (unsigned int idx) const
\begin{DoxyCompactList}\small\item\em Get the Tensor object. \end{DoxyCompactList}\item 
Tensor \& \mbox{\hyperlink{classnntrainer_1_1RunLayerContext_a8055607b0a5be47e772ed3c919957a11}{get\+Tensor\+Grad}} (unsigned int idx)
\begin{DoxyCompactList}\small\item\em Get the Tensor Grad object. \end{DoxyCompactList}\item 
const Tensor \& \mbox{\hyperlink{classnntrainer_1_1RunLayerContext_ad95a143d41438e7a0ea7edbf0b08b697}{get\+Tensor\+Grad}} (unsigned int idx) const
\begin{DoxyCompactList}\small\item\em Get the Tensor Grad object. \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{classnntrainer_1_1RunLayerContext_a87ccbba7d676ecb539764d8c32b823bd}{tensor\+Has\+Gradient}} (unsigned int idx) const
\begin{DoxyCompactList}\small\item\em check if the tensor has gradient \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{classnntrainer_1_1RunLayerContext_ad63696491c259e5eef9f4d2fb2446316}{is\+Weight\+Dependent}} (unsigned int idx) const
\begin{DoxyCompactList}\small\item\em check if the weight is burrowed from others so it is dependent \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{classnntrainer_1_1RunLayerContext_a82a14677cfd4e34c536a68955971c22e}{is\+Gradient\+First\+Access}} (unsigned int idx) const
\begin{DoxyCompactList}\small\item\em check current gradient is first access \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{classnntrainer_1_1RunLayerContext_a8b859d7b3dea63ee3b2472a5a0282695}{is\+Gradient\+Last\+Access}} (unsigned int idx) const
\begin{DoxyCompactList}\small\item\em check current gradient is last access \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{classnntrainer_1_1RunLayerContext_a764350edd970b25c6dd5d0e63fa28ba4}{is\+Gradient\+Clip\+By\+Global\+Norm}} (unsigned int idx) const
\begin{DoxyCompactList}\small\item\em check if the gradient is to be clipped by global norm \end{DoxyCompactList}\item 
const std\+::string \& \mbox{\hyperlink{classnntrainer_1_1RunLayerContext_a9f7c965397888da44ab7af9a71cd7ea2}{get\+Tensor\+Name}} (unsigned int idx) const
\begin{DoxyCompactList}\small\item\em Get the tensor name. \end{DoxyCompactList}\item 
unsigned int \mbox{\hyperlink{classnntrainer_1_1RunLayerContext_a5a37ae83a077352297f254021865abf0}{get\+Num\+Outputs}} () const
\begin{DoxyCompactList}\small\item\em Get the number of Outputs tensor objects. \end{DoxyCompactList}\item 
unsigned int \mbox{\hyperlink{classnntrainer_1_1RunLayerContext_af7c2dac1b142d5ad41512ec81b3c6820}{get\+Num\+Inputs}} () const
\begin{DoxyCompactList}\small\item\em Get the number of inputs tensor objects. \end{DoxyCompactList}\item 
unsigned int \mbox{\hyperlink{classnntrainer_1_1RunLayerContext_a2b309e0ff3d39de20e486caab329a5fe}{get\+Num\+Weights}} () const
\begin{DoxyCompactList}\small\item\em Get the number of weights tensor objects. \end{DoxyCompactList}\item 
unsigned int \mbox{\hyperlink{classnntrainer_1_1RunLayerContext_ae958baa7243e8eb06a2503b97633d6eb}{get\+Num\+Weight\+Opt\+Var}} (unsigned int idx) const
\begin{DoxyCompactList}\small\item\em Get the Number of \mbox{\hyperlink{classnntrainer_1_1Weight}{Weight}} Optimizer Variable tensor object. \end{DoxyCompactList}\item 
unsigned int \mbox{\hyperlink{classnntrainer_1_1RunLayerContext_a2ca97deb1f20f11d1123af4d1ff2405c}{get\+Num\+Tensors}} () const
\begin{DoxyCompactList}\small\item\em Get the number of requested tensors objects. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classnntrainer_1_1RunLayerContext_a556a76f8c7f8aa051e2be970f573b389}{set\+Batch}} (unsigned int batch)
\begin{DoxyCompactList}\small\item\em Set the batch for the run context. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classnntrainer_1_1RunLayerContext_a9d5896e806f780b576e0fb765b40097a}{update\+Tensor}} (unsigned int idx, unsigned int batch)
\begin{DoxyCompactList}\small\item\em Update the dimensions for a requested tensor. \end{DoxyCompactList}\item 
\mbox{\hyperlink{classnntrainer_1_1Weight}{Weight}} \& \mbox{\hyperlink{classnntrainer_1_1RunLayerContext_ab558cc7ad5911e0b25a47153315c1f6b}{get\+Weight\+Object}} (unsigned int idx)
\begin{DoxyCompactList}\small\item\em Get weight object for the weights. \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{classnntrainer_1_1RunLayerContext_ace7412a42ac76542b6ed0b27d5d46fbd}{is\+Label\+Available}} (unsigned int idx) const
\begin{DoxyCompactList}\small\item\em check if the label is available \end{DoxyCompactList}\item 
Tensor \& \mbox{\hyperlink{classnntrainer_1_1RunLayerContext_a3bd304c816d8729256bc5031c9cefb06}{get\+Label}} (unsigned int idx)
\begin{DoxyCompactList}\small\item\em Get label tensor. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{classnntrainer_1_1RunLayerContext_af2203609a385e64ac78dcef57b4f233b}{set\+Loss}} (float val)
\begin{DoxyCompactList}\small\item\em update loss by the layer \end{DoxyCompactList}\item 
float \mbox{\hyperlink{classnntrainer_1_1RunLayerContext_a6d9fef7ad18065358a67294693fe73fb}{get\+Loss}} () const
\begin{DoxyCompactList}\small\item\em update loss by the layer \end{DoxyCompactList}\item 
float \mbox{\hyperlink{classnntrainer_1_1RunLayerContext_a3c129af8d1abcf1539b37d7d0af9f628}{get\+Regularization\+Loss}} () const
\begin{DoxyCompactList}\small\item\em get regularization loss of the layer \end{DoxyCompactList}\item 
const std\+::string \& \mbox{\hyperlink{classnntrainer_1_1RunLayerContext_a347202a58a395ff78194fa864f82c5dc}{get\+Name}} () const
\begin{DoxyCompactList}\small\item\em get name by the layer \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{classnntrainer_1_1RunLayerContext_a9a77c69f467cc5c5a5ea88f41c0e3c3f}{get\+Trainable}} () const
\begin{DoxyCompactList}\small\item\em get trainable by the layer \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{classnntrainer_1_1RunLayerContext_a8aa8dbbe52092724d0c7195a2a5398ce}{ready\+To\+Use}} () const
\begin{DoxyCompactList}\small\item\em check if run context is set and is ready to use \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{classnntrainer_1_1RunLayerContext_abd132539e70ee4f7c1c264621987ee8e}{validate}} (bool skip\+\_\+input=false, bool skip\+\_\+label=false)
\begin{DoxyCompactList}\small\item\em validates the run context after run \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{classnntrainer_1_1RunLayerContext_ae472ef858d05914251c6718326e9aa85}{execute\+In\+Place}} () const
\begin{DoxyCompactList}\small\item\em check if the layer is expected to run in-\/place \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}


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



\doxysubsection{Constructor \& Destructor Documentation}
\mbox{\Hypertarget{classnntrainer_1_1RunLayerContext_a0d0a085d1d66dec386b2f21ec90f2f10}\label{classnntrainer_1_1RunLayerContext_a0d0a085d1d66dec386b2f21ec90f2f10}} 
\index{nntrainer::RunLayerContext@{nntrainer::RunLayerContext}!RunLayerContext@{RunLayerContext}}
\index{RunLayerContext@{RunLayerContext}!nntrainer::RunLayerContext@{nntrainer::RunLayerContext}}
\doxysubsubsection{\texorpdfstring{RunLayerContext()}{RunLayerContext()}\hspace{0.1cm}{\footnotesize\ttfamily [1/3]}}
{\footnotesize\ttfamily nntrainer\+::\+Run\+Layer\+Context\+::\+Run\+Layer\+Context (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



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



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

\mbox{\Hypertarget{classnntrainer_1_1RunLayerContext_a9a33a7625cb327b97c1b7b80a2ef7bcc}\label{classnntrainer_1_1RunLayerContext_a9a33a7625cb327b97c1b7b80a2ef7bcc}} 
\index{nntrainer::RunLayerContext@{nntrainer::RunLayerContext}!RunLayerContext@{RunLayerContext}}
\index{RunLayerContext@{RunLayerContext}!nntrainer::RunLayerContext@{nntrainer::RunLayerContext}}
\doxysubsubsection{\texorpdfstring{RunLayerContext()}{RunLayerContext()}\hspace{0.1cm}{\footnotesize\ttfamily [2/3]}}
{\footnotesize\ttfamily nntrainer\+::\+Run\+Layer\+Context\+::\+Run\+Layer\+Context (\begin{DoxyParamCaption}\item[{const std\+::string \&}]{name,  }\item[{bool}]{in\+\_\+place\+\_\+ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



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



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

\mbox{\Hypertarget{classnntrainer_1_1RunLayerContext_aaa3af6a56b60296891625aeb56a21892}\label{classnntrainer_1_1RunLayerContext_aaa3af6a56b60296891625aeb56a21892}} 
\index{nntrainer::RunLayerContext@{nntrainer::RunLayerContext}!RunLayerContext@{RunLayerContext}}
\index{RunLayerContext@{RunLayerContext}!nntrainer::RunLayerContext@{nntrainer::RunLayerContext}}
\doxysubsubsection{\texorpdfstring{RunLayerContext()}{RunLayerContext()}\hspace{0.1cm}{\footnotesize\ttfamily [3/3]}}
{\footnotesize\ttfamily nntrainer\+::\+Run\+Layer\+Context\+::\+Run\+Layer\+Context (\begin{DoxyParamCaption}\item[{const std\+::string \&}]{name,  }\item[{bool}]{trainable,  }\item[{float}]{l,  }\item[{bool}]{in\+\_\+place\+\_\+,  }\item[{const std\+::vector$<$ \mbox{\hyperlink{classnntrainer_1_1Weight}{Weight}} $\ast$ $>$ \&}]{w,  }\item[{const std\+::vector$<$ \mbox{\hyperlink{classnntrainer_1_1Var__Grad}{Var\+\_\+\+Grad}} $\ast$ $>$ \&}]{in,  }\item[{const std\+::vector$<$ \mbox{\hyperlink{classnntrainer_1_1Var__Grad}{Var\+\_\+\+Grad}} $\ast$ $>$ \&}]{out,  }\item[{const std\+::vector$<$ \mbox{\hyperlink{classnntrainer_1_1Var__Grad}{Var\+\_\+\+Grad}} $\ast$ $>$ \&}]{t }\end{DoxyParamCaption})}



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


\begin{DoxyParams}{Parameters}
{\em name} & name of the layer \\
\hline
{\em trainable} & if the layer is trainable \\
\hline
{\em l} & loss of the layer \\
\hline
{\em in\+\_\+place\+\_\+} & execution in-\/place of the layer \\
\hline
{\em w} & weights of the layer \\
\hline
{\em in} & inputs of the layer \\
\hline
{\em out} & outputs of the layer \\
\hline
{\em t} & extra tensors of the layer \\
\hline
\end{DoxyParams}


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



\doxysubsection{Member Function Documentation}
\mbox{\Hypertarget{classnntrainer_1_1RunLayerContext_ae472ef858d05914251c6718326e9aa85}\label{classnntrainer_1_1RunLayerContext_ae472ef858d05914251c6718326e9aa85}} 
\index{nntrainer::RunLayerContext@{nntrainer::RunLayerContext}!executeInPlace@{executeInPlace}}
\index{executeInPlace@{executeInPlace}!nntrainer::RunLayerContext@{nntrainer::RunLayerContext}}
\doxysubsubsection{\texorpdfstring{executeInPlace()}{executeInPlace()}}
{\footnotesize\ttfamily bool nntrainer\+::\+Run\+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 713 of file layer\+\_\+context.\+h.

\mbox{\Hypertarget{classnntrainer_1_1RunLayerContext_af960325f54392b9d963ba3371e04a793}\label{classnntrainer_1_1RunLayerContext_af960325f54392b9d963ba3371e04a793}} 
\index{nntrainer::RunLayerContext@{nntrainer::RunLayerContext}!getIncomingDerivative@{getIncomingDerivative}}
\index{getIncomingDerivative@{getIncomingDerivative}!nntrainer::RunLayerContext@{nntrainer::RunLayerContext}}
\doxysubsubsection{\texorpdfstring{getIncomingDerivative()}{getIncomingDerivative()}}
{\footnotesize\ttfamily const Tensor nntrainer\+::\+Run\+Layer\+Context\+::get\+Incoming\+Derivative (\begin{DoxyParamCaption}\item[{unsigned int}]{idx }\end{DoxyParamCaption}) const}



Get the incoming Derivative tensor object. 


\begin{DoxyParams}{Parameters}
{\em idx} & Identifier of the output \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Tensor output derivative tensor, if derivative does not have gradient, return a temporary, initialized to zero
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em idx} & Identifier of the output \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Tensor tensor to incoming derivative. If 
\end{DoxyReturn}


Definition at line 274 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_1RunLayerContext_af960325f54392b9d963ba3371e04a793_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_1RunLayerContext_af960325f54392b9d963ba3371e04a793_icgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{classnntrainer_1_1RunLayerContext_a1df0ac37074287ffd4c0aec5b56ccdab}\label{classnntrainer_1_1RunLayerContext_a1df0ac37074287ffd4c0aec5b56ccdab}} 
\index{nntrainer::RunLayerContext@{nntrainer::RunLayerContext}!getInput@{getInput}}
\index{getInput@{getInput}!nntrainer::RunLayerContext@{nntrainer::RunLayerContext}}
\doxysubsubsection{\texorpdfstring{getInput()}{getInput()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily Tensor \& nntrainer\+::\+Run\+Layer\+Context\+::get\+Input (\begin{DoxyParamCaption}\item[{unsigned int}]{idx }\end{DoxyParamCaption})}



Get the Input tensor object. 


\begin{DoxyParams}{Parameters}
{\em idx} & Identifier of the input \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Tensor\& Reference to the input grad tensor 
\end{DoxyReturn}


Definition at line 284 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_1RunLayerContext_a1df0ac37074287ffd4c0aec5b56ccdab_icgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{classnntrainer_1_1RunLayerContext_ae28599f9e17899bd3864c6a478f95268}\label{classnntrainer_1_1RunLayerContext_ae28599f9e17899bd3864c6a478f95268}} 
\index{nntrainer::RunLayerContext@{nntrainer::RunLayerContext}!getInput@{getInput}}
\index{getInput@{getInput}!nntrainer::RunLayerContext@{nntrainer::RunLayerContext}}
\doxysubsubsection{\texorpdfstring{getInput()}{getInput()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily const Tensor \& nntrainer\+::\+Run\+Layer\+Context\+::get\+Input (\begin{DoxyParamCaption}\item[{unsigned int}]{idx }\end{DoxyParamCaption}) const}



Get the Input tensor object. 


\begin{DoxyParams}{Parameters}
{\em idx} & Identifier of the input \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Tensor\& Reference to the input grad tensor 
\end{DoxyReturn}


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

\mbox{\Hypertarget{classnntrainer_1_1RunLayerContext_ab32143d119bad58d8475401bc2c5d80c}\label{classnntrainer_1_1RunLayerContext_ab32143d119bad58d8475401bc2c5d80c}} 
\index{nntrainer::RunLayerContext@{nntrainer::RunLayerContext}!getInputGrad@{getInputGrad}}
\index{getInputGrad@{getInputGrad}!nntrainer::RunLayerContext@{nntrainer::RunLayerContext}}
\doxysubsubsection{\texorpdfstring{getInputGrad()}{getInputGrad()}}
{\footnotesize\ttfamily Tensor \& nntrainer\+::\+Run\+Layer\+Context\+::get\+Input\+Grad (\begin{DoxyParamCaption}\item[{unsigned int}]{idx }\end{DoxyParamCaption})}



Get the Input Grad tensor object. 


\begin{DoxyParams}{Parameters}
{\em idx} & Identifier of the input \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Tensor\& Reference to the input grad tensor 
\end{DoxyReturn}


Definition at line 298 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_1RunLayerContext_ab32143d119bad58d8475401bc2c5d80c_icgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{classnntrainer_1_1RunLayerContext_a3bd304c816d8729256bc5031c9cefb06}\label{classnntrainer_1_1RunLayerContext_a3bd304c816d8729256bc5031c9cefb06}} 
\index{nntrainer::RunLayerContext@{nntrainer::RunLayerContext}!getLabel@{getLabel}}
\index{getLabel@{getLabel}!nntrainer::RunLayerContext@{nntrainer::RunLayerContext}}
\doxysubsubsection{\texorpdfstring{getLabel()}{getLabel()}}
{\footnotesize\ttfamily Tensor \& nntrainer\+::\+Run\+Layer\+Context\+::get\+Label (\begin{DoxyParamCaption}\item[{unsigned int}]{idx }\end{DoxyParamCaption})}



Get label tensor. 


\begin{DoxyParams}{Parameters}
{\em idx} & Identifier of the input \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Tensor\& Reference to the label tensor 
\end{DoxyReturn}


Definition at line 457 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_1RunLayerContext_a3bd304c816d8729256bc5031c9cefb06_cgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{classnntrainer_1_1RunLayerContext_a6d9fef7ad18065358a67294693fe73fb}\label{classnntrainer_1_1RunLayerContext_a6d9fef7ad18065358a67294693fe73fb}} 
\index{nntrainer::RunLayerContext@{nntrainer::RunLayerContext}!getLoss@{getLoss}}
\index{getLoss@{getLoss}!nntrainer::RunLayerContext@{nntrainer::RunLayerContext}}
\doxysubsubsection{\texorpdfstring{getLoss()}{getLoss()}}
{\footnotesize\ttfamily float nntrainer\+::\+Run\+Layer\+Context\+::get\+Loss (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



update loss by the layer 

\begin{DoxyReturn}{Returns}
loss of the layer 
\end{DoxyReturn}
\begin{DoxyNote}{Note}
does not includes the regularization loss. 
\end{DoxyNote}


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

\mbox{\Hypertarget{classnntrainer_1_1RunLayerContext_a347202a58a395ff78194fa864f82c5dc}\label{classnntrainer_1_1RunLayerContext_a347202a58a395ff78194fa864f82c5dc}} 
\index{nntrainer::RunLayerContext@{nntrainer::RunLayerContext}!getName@{getName}}
\index{getName@{getName}!nntrainer::RunLayerContext@{nntrainer::RunLayerContext}}
\doxysubsubsection{\texorpdfstring{getName()}{getName()}}
{\footnotesize\ttfamily const std\+::string\& nntrainer\+::\+Run\+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 682 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_1RunLayerContext_a347202a58a395ff78194fa864f82c5dc_icgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{classnntrainer_1_1RunLayerContext_af7c2dac1b142d5ad41512ec81b3c6820}\label{classnntrainer_1_1RunLayerContext_af7c2dac1b142d5ad41512ec81b3c6820}} 
\index{nntrainer::RunLayerContext@{nntrainer::RunLayerContext}!getNumInputs@{getNumInputs}}
\index{getNumInputs@{getNumInputs}!nntrainer::RunLayerContext@{nntrainer::RunLayerContext}}
\doxysubsubsection{\texorpdfstring{getNumInputs()}{getNumInputs()}}
{\footnotesize\ttfamily unsigned int nntrainer\+::\+Run\+Layer\+Context\+::get\+Num\+Inputs (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get the number of inputs tensor objects. 

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


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

\mbox{\Hypertarget{classnntrainer_1_1RunLayerContext_a5a37ae83a077352297f254021865abf0}\label{classnntrainer_1_1RunLayerContext_a5a37ae83a077352297f254021865abf0}} 
\index{nntrainer::RunLayerContext@{nntrainer::RunLayerContext}!getNumOutputs@{getNumOutputs}}
\index{getNumOutputs@{getNumOutputs}!nntrainer::RunLayerContext@{nntrainer::RunLayerContext}}
\doxysubsubsection{\texorpdfstring{getNumOutputs()}{getNumOutputs()}}
{\footnotesize\ttfamily unsigned int nntrainer\+::\+Run\+Layer\+Context\+::get\+Num\+Outputs (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Get the number of Outputs tensor objects. 

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


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

\mbox{\Hypertarget{classnntrainer_1_1RunLayerContext_a2ca97deb1f20f11d1123af4d1ff2405c}\label{classnntrainer_1_1RunLayerContext_a2ca97deb1f20f11d1123af4d1ff2405c}} 
\index{nntrainer::RunLayerContext@{nntrainer::RunLayerContext}!getNumTensors@{getNumTensors}}
\index{getNumTensors@{getNumTensors}!nntrainer::RunLayerContext@{nntrainer::RunLayerContext}}
\doxysubsubsection{\texorpdfstring{getNumTensors()}{getNumTensors()}}
{\footnotesize\ttfamily unsigned int nntrainer\+::\+Run\+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 606 of file layer\+\_\+context.\+h.

\mbox{\Hypertarget{classnntrainer_1_1RunLayerContext_ae958baa7243e8eb06a2503b97633d6eb}\label{classnntrainer_1_1RunLayerContext_ae958baa7243e8eb06a2503b97633d6eb}} 
\index{nntrainer::RunLayerContext@{nntrainer::RunLayerContext}!getNumWeightOptVar@{getNumWeightOptVar}}
\index{getNumWeightOptVar@{getNumWeightOptVar}!nntrainer::RunLayerContext@{nntrainer::RunLayerContext}}
\doxysubsubsection{\texorpdfstring{getNumWeightOptVar()}{getNumWeightOptVar()}}
{\footnotesize\ttfamily unsigned int nntrainer\+::\+Run\+Layer\+Context\+::get\+Num\+Weight\+Opt\+Var (\begin{DoxyParamCaption}\item[{unsigned int}]{idx }\end{DoxyParamCaption}) const}



Get the Number of \mbox{\hyperlink{classnntrainer_1_1Weight}{Weight}} Optimizer Variable tensor object. 


\begin{DoxyParams}{Parameters}
{\em idx} & Identifier of the weight \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
unsigned int Number of the weight optimizer variable
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em idx} & Identifier of the weight \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
int Number of the weight optimizer variable 
\end{DoxyReturn}


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

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



Get the number of weights tensor objects. 

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


Definition at line 591 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_1RunLayerContext_a2b309e0ff3d39de20e486caab329a5fe_icgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{classnntrainer_1_1RunLayerContext_ad7980e5a12d15ba89f510f8c138ee30b}\label{classnntrainer_1_1RunLayerContext_ad7980e5a12d15ba89f510f8c138ee30b}} 
\index{nntrainer::RunLayerContext@{nntrainer::RunLayerContext}!getOutgoingDerivative@{getOutgoingDerivative}}
\index{getOutgoingDerivative@{getOutgoingDerivative}!nntrainer::RunLayerContext@{nntrainer::RunLayerContext}}
\doxysubsubsection{\texorpdfstring{getOutgoingDerivative()}{getOutgoingDerivative()}}
{\footnotesize\ttfamily Tensor \& nntrainer\+::\+Run\+Layer\+Context\+::get\+Outgoing\+Derivative (\begin{DoxyParamCaption}\item[{unsigned int}]{idx }\end{DoxyParamCaption})}



Get the outgoing Derivative tensor object. 


\begin{DoxyParams}{Parameters}
{\em idx} & Identifier of the input \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Tensor\& Reference to the input derivative tensor 
\end{DoxyReturn}


Definition at line 323 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_1RunLayerContext_ad7980e5a12d15ba89f510f8c138ee30b_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_1RunLayerContext_ad7980e5a12d15ba89f510f8c138ee30b_icgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{classnntrainer_1_1RunLayerContext_a0a7775c31a49a29f550d8889fab653e5}\label{classnntrainer_1_1RunLayerContext_a0a7775c31a49a29f550d8889fab653e5}} 
\index{nntrainer::RunLayerContext@{nntrainer::RunLayerContext}!getOutput@{getOutput}}
\index{getOutput@{getOutput}!nntrainer::RunLayerContext@{nntrainer::RunLayerContext}}
\doxysubsubsection{\texorpdfstring{getOutput()}{getOutput()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily Tensor \& nntrainer\+::\+Run\+Layer\+Context\+::get\+Output (\begin{DoxyParamCaption}\item[{unsigned int}]{idx }\end{DoxyParamCaption})}



Get the Output tensor object. 


\begin{DoxyParams}{Parameters}
{\em idx} & Identifier of the output \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Tensor\& Reference to the output tensor 
\end{DoxyReturn}


Definition at line 224 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_1RunLayerContext_a0a7775c31a49a29f550d8889fab653e5_icgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{classnntrainer_1_1RunLayerContext_ab57219afb1de23ec8c26dcaa4a15eaaa}\label{classnntrainer_1_1RunLayerContext_ab57219afb1de23ec8c26dcaa4a15eaaa}} 
\index{nntrainer::RunLayerContext@{nntrainer::RunLayerContext}!getOutput@{getOutput}}
\index{getOutput@{getOutput}!nntrainer::RunLayerContext@{nntrainer::RunLayerContext}}
\doxysubsubsection{\texorpdfstring{getOutput()}{getOutput()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily const Tensor \& nntrainer\+::\+Run\+Layer\+Context\+::get\+Output (\begin{DoxyParamCaption}\item[{unsigned int}]{idx }\end{DoxyParamCaption}) const}



Get the Output tensor object. 


\begin{DoxyParams}{Parameters}
{\em idx} & Identifier of the output \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Tensor\& Reference to the output tensor 
\end{DoxyReturn}


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

\mbox{\Hypertarget{classnntrainer_1_1RunLayerContext_a327af7d7dc0262062bcc8cb97ca1d9e2}\label{classnntrainer_1_1RunLayerContext_a327af7d7dc0262062bcc8cb97ca1d9e2}} 
\index{nntrainer::RunLayerContext@{nntrainer::RunLayerContext}!getOutputGrad@{getOutputGrad}}
\index{getOutputGrad@{getOutputGrad}!nntrainer::RunLayerContext@{nntrainer::RunLayerContext}}
\doxysubsubsection{\texorpdfstring{getOutputGrad()}{getOutputGrad()}}
{\footnotesize\ttfamily const Tensor nntrainer\+::\+Run\+Layer\+Context\+::get\+Output\+Grad (\begin{DoxyParamCaption}\item[{unsigned int}]{idx }\end{DoxyParamCaption}) const}



Get the Output Grad tensor object. 


\begin{DoxyParams}{Parameters}
{\em idx} & Identifier of the output \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Read-\/only output grad tensor, if derivative does not have gradient, return a temporary, initialized to zero
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em idx} & Identifier of the output \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Tensor Read-\/only output grad tensor 
\end{DoxyReturn}


Definition at line 238 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_1RunLayerContext_a327af7d7dc0262062bcc8cb97ca1d9e2_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_1RunLayerContext_a327af7d7dc0262062bcc8cb97ca1d9e2_icgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{classnntrainer_1_1RunLayerContext_a5e772b4f30b2102a9aa9dc7a52a5e75f}\label{classnntrainer_1_1RunLayerContext_a5e772b4f30b2102a9aa9dc7a52a5e75f}} 
\index{nntrainer::RunLayerContext@{nntrainer::RunLayerContext}!getOutputGradUnsafe@{getOutputGradUnsafe}}
\index{getOutputGradUnsafe@{getOutputGradUnsafe}!nntrainer::RunLayerContext@{nntrainer::RunLayerContext}}
\doxysubsubsection{\texorpdfstring{getOutputGradUnsafe()}{getOutputGradUnsafe()}}
{\footnotesize\ttfamily Tensor \& nntrainer\+::\+Run\+Layer\+Context\+::get\+Output\+Grad\+Unsafe (\begin{DoxyParamCaption}\item[{unsigned int}]{idx }\end{DoxyParamCaption})}



Get the Output Grad tensor object. 


\begin{DoxyParams}{Parameters}
{\em idx} & Identifier of the output \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Tensor\& Reference to the output grad tensor, this is valid only if the given output is trainable
\end{DoxyReturn}
\begin{DoxyNote}{Note}
recommended to N\+OT use this function as a layer developer but rather use \mbox{\hyperlink{classnntrainer_1_1RunLayerContext_a327af7d7dc0262062bcc8cb97ca1d9e2}{get\+Output\+Grad()}}.
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em idx} & Identifier of the output \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Tensor\& Reference to the output grad tensor
\end{DoxyReturn}
\begin{DoxyNote}{Note}
recommended to N\+OT use this function as a layer developer but rather use \mbox{\hyperlink{classnntrainer_1_1RunLayerContext_a327af7d7dc0262062bcc8cb97ca1d9e2}{get\+Output\+Grad()}}. 
\end{DoxyNote}


Definition at line 264 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_1RunLayerContext_a5e772b4f30b2102a9aa9dc7a52a5e75f_icgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{classnntrainer_1_1RunLayerContext_a3c129af8d1abcf1539b37d7d0af9f628}\label{classnntrainer_1_1RunLayerContext_a3c129af8d1abcf1539b37d7d0af9f628}} 
\index{nntrainer::RunLayerContext@{nntrainer::RunLayerContext}!getRegularizationLoss@{getRegularizationLoss}}
\index{getRegularizationLoss@{getRegularizationLoss}!nntrainer::RunLayerContext@{nntrainer::RunLayerContext}}
\doxysubsubsection{\texorpdfstring{getRegularizationLoss()}{getRegularizationLoss()}}
{\footnotesize\ttfamily float nntrainer\+::\+Run\+Layer\+Context\+::get\+Regularization\+Loss (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



get regularization loss of the layer 

\begin{DoxyReturn}{Returns}
regularization loss of the layer 
\end{DoxyReturn}


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

Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classnntrainer_1_1RunLayerContext_a3c129af8d1abcf1539b37d7d0af9f628_cgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{classnntrainer_1_1RunLayerContext_a76211b8d6caf1fbec9442c99918245e0}\label{classnntrainer_1_1RunLayerContext_a76211b8d6caf1fbec9442c99918245e0}} 
\index{nntrainer::RunLayerContext@{nntrainer::RunLayerContext}!getTensor@{getTensor}}
\index{getTensor@{getTensor}!nntrainer::RunLayerContext@{nntrainer::RunLayerContext}}
\doxysubsubsection{\texorpdfstring{getTensor()}{getTensor()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily Tensor \& nntrainer\+::\+Run\+Layer\+Context\+::get\+Tensor (\begin{DoxyParamCaption}\item[{unsigned int}]{idx }\end{DoxyParamCaption})}



Get the Tensor object. 


\begin{DoxyParams}{Parameters}
{\em idx} & Identifier of the tensor \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Tensor\& Reference to the tensor 
\end{DoxyReturn}


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

\mbox{\Hypertarget{classnntrainer_1_1RunLayerContext_a9286c41a4799b3a3a9c04c1b959ee392}\label{classnntrainer_1_1RunLayerContext_a9286c41a4799b3a3a9c04c1b959ee392}} 
\index{nntrainer::RunLayerContext@{nntrainer::RunLayerContext}!getTensor@{getTensor}}
\index{getTensor@{getTensor}!nntrainer::RunLayerContext@{nntrainer::RunLayerContext}}
\doxysubsubsection{\texorpdfstring{getTensor()}{getTensor()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily const Tensor \& nntrainer\+::\+Run\+Layer\+Context\+::get\+Tensor (\begin{DoxyParamCaption}\item[{unsigned int}]{idx }\end{DoxyParamCaption}) const}



Get the Tensor object. 


\begin{DoxyParams}{Parameters}
{\em idx} & Identifier of the tensor \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Tensor\& Reference to the tensor 
\end{DoxyReturn}


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

\mbox{\Hypertarget{classnntrainer_1_1RunLayerContext_a8055607b0a5be47e772ed3c919957a11}\label{classnntrainer_1_1RunLayerContext_a8055607b0a5be47e772ed3c919957a11}} 
\index{nntrainer::RunLayerContext@{nntrainer::RunLayerContext}!getTensorGrad@{getTensorGrad}}
\index{getTensorGrad@{getTensorGrad}!nntrainer::RunLayerContext@{nntrainer::RunLayerContext}}
\doxysubsubsection{\texorpdfstring{getTensorGrad()}{getTensorGrad()}\hspace{0.1cm}{\footnotesize\ttfamily [1/2]}}
{\footnotesize\ttfamily Tensor \& nntrainer\+::\+Run\+Layer\+Context\+::get\+Tensor\+Grad (\begin{DoxyParamCaption}\item[{unsigned int}]{idx }\end{DoxyParamCaption})}



Get the Tensor Grad object. 


\begin{DoxyParams}{Parameters}
{\em idx} & Identifier of the tensor \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Tensor\& Reference to the tensor grad tensor 
\end{DoxyReturn}


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

\mbox{\Hypertarget{classnntrainer_1_1RunLayerContext_ad95a143d41438e7a0ea7edbf0b08b697}\label{classnntrainer_1_1RunLayerContext_ad95a143d41438e7a0ea7edbf0b08b697}} 
\index{nntrainer::RunLayerContext@{nntrainer::RunLayerContext}!getTensorGrad@{getTensorGrad}}
\index{getTensorGrad@{getTensorGrad}!nntrainer::RunLayerContext@{nntrainer::RunLayerContext}}
\doxysubsubsection{\texorpdfstring{getTensorGrad()}{getTensorGrad()}\hspace{0.1cm}{\footnotesize\ttfamily [2/2]}}
{\footnotesize\ttfamily const Tensor \& nntrainer\+::\+Run\+Layer\+Context\+::get\+Tensor\+Grad (\begin{DoxyParamCaption}\item[{unsigned int}]{idx }\end{DoxyParamCaption}) const}



Get the Tensor Grad object. 


\begin{DoxyParams}{Parameters}
{\em idx} & Identifier of the tensor \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Tensor\& Reference to the tensor grad tensor 
\end{DoxyReturn}


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

\mbox{\Hypertarget{classnntrainer_1_1RunLayerContext_a9f7c965397888da44ab7af9a71cd7ea2}\label{classnntrainer_1_1RunLayerContext_a9f7c965397888da44ab7af9a71cd7ea2}} 
\index{nntrainer::RunLayerContext@{nntrainer::RunLayerContext}!getTensorName@{getTensorName}}
\index{getTensorName@{getTensorName}!nntrainer::RunLayerContext@{nntrainer::RunLayerContext}}
\doxysubsubsection{\texorpdfstring{getTensorName()}{getTensorName()}}
{\footnotesize\ttfamily const std\+::string \& nntrainer\+::\+Run\+Layer\+Context\+::get\+Tensor\+Name (\begin{DoxyParamCaption}\item[{unsigned int}]{idx }\end{DoxyParamCaption}) const}



Get the tensor name. 


\begin{DoxyParams}{Parameters}
{\em idx} & Identifier of the tensor \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
name of the tensor 
\end{DoxyReturn}


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

\mbox{\Hypertarget{classnntrainer_1_1RunLayerContext_a9a77c69f467cc5c5a5ea88f41c0e3c3f}\label{classnntrainer_1_1RunLayerContext_a9a77c69f467cc5c5a5ea88f41c0e3c3f}} 
\index{nntrainer::RunLayerContext@{nntrainer::RunLayerContext}!getTrainable@{getTrainable}}
\index{getTrainable@{getTrainable}!nntrainer::RunLayerContext@{nntrainer::RunLayerContext}}
\doxysubsubsection{\texorpdfstring{getTrainable()}{getTrainable()}}
{\footnotesize\ttfamily bool nntrainer\+::\+Run\+Layer\+Context\+::get\+Trainable (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



get trainable by the layer 

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


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

\mbox{\Hypertarget{classnntrainer_1_1RunLayerContext_a11595345a129892ad63fd6dfc847a380}\label{classnntrainer_1_1RunLayerContext_a11595345a129892ad63fd6dfc847a380}} 
\index{nntrainer::RunLayerContext@{nntrainer::RunLayerContext}!getWeight@{getWeight}}
\index{getWeight@{getWeight}!nntrainer::RunLayerContext@{nntrainer::RunLayerContext}}
\doxysubsubsection{\texorpdfstring{getWeight()}{getWeight()}}
{\footnotesize\ttfamily Tensor \& nntrainer\+::\+Run\+Layer\+Context\+::get\+Weight (\begin{DoxyParamCaption}\item[{unsigned int}]{idx }\end{DoxyParamCaption}) const}



Get the \mbox{\hyperlink{classnntrainer_1_1Weight}{Weight}} tensor object. 


\begin{DoxyParams}{Parameters}
{\em idx} & Identifier of the weight \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Tensor\& Reference to the weight tensor 
\end{DoxyReturn}


Definition at line 149 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_1RunLayerContext_a11595345a129892ad63fd6dfc847a380_icgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{classnntrainer_1_1RunLayerContext_a5d9340845433ecdb493e712681ed0df7}\label{classnntrainer_1_1RunLayerContext_a5d9340845433ecdb493e712681ed0df7}} 
\index{nntrainer::RunLayerContext@{nntrainer::RunLayerContext}!getWeightGrad@{getWeightGrad}}
\index{getWeightGrad@{getWeightGrad}!nntrainer::RunLayerContext@{nntrainer::RunLayerContext}}
\doxysubsubsection{\texorpdfstring{getWeightGrad()}{getWeightGrad()}}
{\footnotesize\ttfamily Tensor \& nntrainer\+::\+Run\+Layer\+Context\+::get\+Weight\+Grad (\begin{DoxyParamCaption}\item[{unsigned int}]{idx }\end{DoxyParamCaption}) const}



Get the \mbox{\hyperlink{classnntrainer_1_1Weight}{Weight}} Gradient tensor object. 

\begin{DoxyNote}{Note}
this method returns the fresh gradient to be filled 
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em idx} & Identifier of the weight \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Tensor\& Reference to the weight grad tensor
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em idx} & Identifier of the weight \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Tensor\& Reference to the weight grad tensor 
\end{DoxyReturn}


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

\mbox{\Hypertarget{classnntrainer_1_1RunLayerContext_a935c2656d34f64ae429e8bb268e702d2}\label{classnntrainer_1_1RunLayerContext_a935c2656d34f64ae429e8bb268e702d2}} 
\index{nntrainer::RunLayerContext@{nntrainer::RunLayerContext}!getWeightName@{getWeightName}}
\index{getWeightName@{getWeightName}!nntrainer::RunLayerContext@{nntrainer::RunLayerContext}}
\doxysubsubsection{\texorpdfstring{getWeightName()}{getWeightName()}}
{\footnotesize\ttfamily const std\+::string \& nntrainer\+::\+Run\+Layer\+Context\+::get\+Weight\+Name (\begin{DoxyParamCaption}\item[{unsigned int}]{idx }\end{DoxyParamCaption}) const}



Get the \mbox{\hyperlink{classnntrainer_1_1Weight}{Weight}} name. 


\begin{DoxyParams}{Parameters}
{\em idx} & Identifier of the weight \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
name of the weight 
\end{DoxyReturn}


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

\mbox{\Hypertarget{classnntrainer_1_1RunLayerContext_ab558cc7ad5911e0b25a47153315c1f6b}\label{classnntrainer_1_1RunLayerContext_ab558cc7ad5911e0b25a47153315c1f6b}} 
\index{nntrainer::RunLayerContext@{nntrainer::RunLayerContext}!getWeightObject@{getWeightObject}}
\index{getWeightObject@{getWeightObject}!nntrainer::RunLayerContext@{nntrainer::RunLayerContext}}
\doxysubsubsection{\texorpdfstring{getWeightObject()}{getWeightObject()}}
{\footnotesize\ttfamily \mbox{\hyperlink{classnntrainer_1_1Weight}{Weight}} \& nntrainer\+::\+Run\+Layer\+Context\+::get\+Weight\+Object (\begin{DoxyParamCaption}\item[{unsigned int}]{idx }\end{DoxyParamCaption})}



Get weight object for the weights. 


\begin{DoxyParams}{Parameters}
{\em idx} & index of the weight (identifier) \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
weight object 
\end{DoxyReturn}


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

\mbox{\Hypertarget{classnntrainer_1_1RunLayerContext_a2ffdfd438d5e6a9167ad9d854e17b274}\label{classnntrainer_1_1RunLayerContext_a2ffdfd438d5e6a9167ad9d854e17b274}} 
\index{nntrainer::RunLayerContext@{nntrainer::RunLayerContext}!getWeightOptVar@{getWeightOptVar}}
\index{getWeightOptVar@{getWeightOptVar}!nntrainer::RunLayerContext@{nntrainer::RunLayerContext}}
\doxysubsubsection{\texorpdfstring{getWeightOptVar()}{getWeightOptVar()}}
{\footnotesize\ttfamily Tensor \& nntrainer\+::\+Run\+Layer\+Context\+::get\+Weight\+Opt\+Var (\begin{DoxyParamCaption}\item[{unsigned int}]{idx,  }\item[{unsigned int}]{jdx }\end{DoxyParamCaption}) const}



Get the \mbox{\hyperlink{classnntrainer_1_1Weight}{Weight}} Optimizer Variable tensor object. 


\begin{DoxyParams}{Parameters}
{\em idx} & Identifier of the weight \\
\hline
{\em jdx} & Identifier of the weight optimizer variable \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Tensor\& Reference to the weight grad tensor
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em idx} & Identifier of the weight \\
\hline
{\em jdx} & Identifier of the optimizer variables \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
Tensor\& Reference to the weight optimizer variable tensor 
\end{DoxyReturn}


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

\mbox{\Hypertarget{classnntrainer_1_1RunLayerContext_a495b8f2664d455982f371d75884b98f3}\label{classnntrainer_1_1RunLayerContext_a495b8f2664d455982f371d75884b98f3}} 
\index{nntrainer::RunLayerContext@{nntrainer::RunLayerContext}!inputHasGradient@{inputHasGradient}}
\index{inputHasGradient@{inputHasGradient}!nntrainer::RunLayerContext@{nntrainer::RunLayerContext}}
\doxysubsubsection{\texorpdfstring{inputHasGradient()}{inputHasGradient()}}
{\footnotesize\ttfamily bool nntrainer\+::\+Run\+Layer\+Context\+::input\+Has\+Gradient (\begin{DoxyParamCaption}\item[{unsigned int}]{idx }\end{DoxyParamCaption}) const}



check if the weight has gradient 

check if the input has gradient


\begin{DoxyParams}{Parameters}
{\em idx} & Identifier of the weight \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true if weight has gradient, else false
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em idx} & Identifier of the input \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true if output has gradient, else false 
\end{DoxyReturn}


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

\mbox{\Hypertarget{classnntrainer_1_1RunLayerContext_a764350edd970b25c6dd5d0e63fa28ba4}\label{classnntrainer_1_1RunLayerContext_a764350edd970b25c6dd5d0e63fa28ba4}} 
\index{nntrainer::RunLayerContext@{nntrainer::RunLayerContext}!isGradientClipByGlobalNorm@{isGradientClipByGlobalNorm}}
\index{isGradientClipByGlobalNorm@{isGradientClipByGlobalNorm}!nntrainer::RunLayerContext@{nntrainer::RunLayerContext}}
\doxysubsubsection{\texorpdfstring{isGradientClipByGlobalNorm()}{isGradientClipByGlobalNorm()}}
{\footnotesize\ttfamily bool nntrainer\+::\+Run\+Layer\+Context\+::is\+Gradient\+Clip\+By\+Global\+Norm (\begin{DoxyParamCaption}\item[{unsigned int}]{idx }\end{DoxyParamCaption}) const}



check if the gradient is to be clipped by global norm 


\begin{DoxyParams}{Parameters}
{\em idx} & index \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
bool true if it is to be clipped else false 
\end{DoxyReturn}


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

\mbox{\Hypertarget{classnntrainer_1_1RunLayerContext_a82a14677cfd4e34c536a68955971c22e}\label{classnntrainer_1_1RunLayerContext_a82a14677cfd4e34c536a68955971c22e}} 
\index{nntrainer::RunLayerContext@{nntrainer::RunLayerContext}!isGradientFirstAccess@{isGradientFirstAccess}}
\index{isGradientFirstAccess@{isGradientFirstAccess}!nntrainer::RunLayerContext@{nntrainer::RunLayerContext}}
\doxysubsubsection{\texorpdfstring{isGradientFirstAccess()}{isGradientFirstAccess()}}
{\footnotesize\ttfamily bool nntrainer\+::\+Run\+Layer\+Context\+::is\+Gradient\+First\+Access (\begin{DoxyParamCaption}\item[{unsigned int}]{idx }\end{DoxyParamCaption}) const}



check current gradient is first access 

\begin{DoxyNote}{Note}
for now, it equivalent to weight last access, so this value is accessible for non-\/trainable weights as well. This is in terms of execution order.
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em idx} & index \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
bool true if first access 
\end{DoxyReturn}


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

\mbox{\Hypertarget{classnntrainer_1_1RunLayerContext_a8b859d7b3dea63ee3b2472a5a0282695}\label{classnntrainer_1_1RunLayerContext_a8b859d7b3dea63ee3b2472a5a0282695}} 
\index{nntrainer::RunLayerContext@{nntrainer::RunLayerContext}!isGradientLastAccess@{isGradientLastAccess}}
\index{isGradientLastAccess@{isGradientLastAccess}!nntrainer::RunLayerContext@{nntrainer::RunLayerContext}}
\doxysubsubsection{\texorpdfstring{isGradientLastAccess()}{isGradientLastAccess()}}
{\footnotesize\ttfamily bool nntrainer\+::\+Run\+Layer\+Context\+::is\+Gradient\+Last\+Access (\begin{DoxyParamCaption}\item[{unsigned int}]{idx }\end{DoxyParamCaption}) const}



check current gradient is last access 

\begin{DoxyNote}{Note}
for now, it equivalent to weight last access, so this value is accessible for non-\/trainable weights as well. This is in terms of execution order.
\end{DoxyNote}

\begin{DoxyParams}{Parameters}
{\em idx} & index \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
bool true if last access 
\end{DoxyReturn}


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

\mbox{\Hypertarget{classnntrainer_1_1RunLayerContext_ace7412a42ac76542b6ed0b27d5d46fbd}\label{classnntrainer_1_1RunLayerContext_ace7412a42ac76542b6ed0b27d5d46fbd}} 
\index{nntrainer::RunLayerContext@{nntrainer::RunLayerContext}!isLabelAvailable@{isLabelAvailable}}
\index{isLabelAvailable@{isLabelAvailable}!nntrainer::RunLayerContext@{nntrainer::RunLayerContext}}
\doxysubsubsection{\texorpdfstring{isLabelAvailable()}{isLabelAvailable()}}
{\footnotesize\ttfamily bool nntrainer\+::\+Run\+Layer\+Context\+::is\+Label\+Available (\begin{DoxyParamCaption}\item[{unsigned int}]{idx }\end{DoxyParamCaption}) const}



check if the label is available 


\begin{DoxyParams}{Parameters}
{\em idx} & Identifier of the input \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true if label is available else false 
\end{DoxyReturn}


Definition at line 447 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_1RunLayerContext_ace7412a42ac76542b6ed0b27d5d46fbd_icgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{classnntrainer_1_1RunLayerContext_ad63696491c259e5eef9f4d2fb2446316}\label{classnntrainer_1_1RunLayerContext_ad63696491c259e5eef9f4d2fb2446316}} 
\index{nntrainer::RunLayerContext@{nntrainer::RunLayerContext}!isWeightDependent@{isWeightDependent}}
\index{isWeightDependent@{isWeightDependent}!nntrainer::RunLayerContext@{nntrainer::RunLayerContext}}
\doxysubsubsection{\texorpdfstring{isWeightDependent()}{isWeightDependent()}}
{\footnotesize\ttfamily bool nntrainer\+::\+Run\+Layer\+Context\+::is\+Weight\+Dependent (\begin{DoxyParamCaption}\item[{unsigned int}]{idx }\end{DoxyParamCaption}) const}



check if the weight is burrowed from others so it is dependent 


\begin{DoxyParams}{Parameters}
{\em idx} & index \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
bool true if weight is burrowed from outside 
\end{DoxyReturn}


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

\mbox{\Hypertarget{classnntrainer_1_1RunLayerContext_a86c370d449c2daf951fda2910347fa8e}\label{classnntrainer_1_1RunLayerContext_a86c370d449c2daf951fda2910347fa8e}} 
\index{nntrainer::RunLayerContext@{nntrainer::RunLayerContext}!outputHasGradient@{outputHasGradient}}
\index{outputHasGradient@{outputHasGradient}!nntrainer::RunLayerContext@{nntrainer::RunLayerContext}}
\doxysubsubsection{\texorpdfstring{outputHasGradient()}{outputHasGradient()}}
{\footnotesize\ttfamily bool nntrainer\+::\+Run\+Layer\+Context\+::output\+Has\+Gradient (\begin{DoxyParamCaption}\item[{unsigned int}]{idx }\end{DoxyParamCaption}) const}



check if the weight has gradient 

check if the output has gradient


\begin{DoxyParams}{Parameters}
{\em idx} & Identifier of the weight \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true if weight has gradient, else false
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em idx} & Identifier of the output \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true if output has gradient, else false 
\end{DoxyReturn}


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

\mbox{\Hypertarget{classnntrainer_1_1RunLayerContext_a8aa8dbbe52092724d0c7195a2a5398ce}\label{classnntrainer_1_1RunLayerContext_a8aa8dbbe52092724d0c7195a2a5398ce}} 
\index{nntrainer::RunLayerContext@{nntrainer::RunLayerContext}!readyToUse@{readyToUse}}
\index{readyToUse@{readyToUse}!nntrainer::RunLayerContext@{nntrainer::RunLayerContext}}
\doxysubsubsection{\texorpdfstring{readyToUse()}{readyToUse()}}
{\footnotesize\ttfamily bool nntrainer\+::\+Run\+Layer\+Context\+::ready\+To\+Use (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const}



check if run context is set and is ready to use 

\begin{DoxyReturn}{Returns}
true if ready, else false 
\end{DoxyReturn}
assumption\+:
\begin{DoxyEnumerate}
\item there must be at least 1 input
\item the setter set everything at once
\end{DoxyEnumerate}

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

\mbox{\Hypertarget{classnntrainer_1_1RunLayerContext_a556a76f8c7f8aa051e2be970f573b389}\label{classnntrainer_1_1RunLayerContext_a556a76f8c7f8aa051e2be970f573b389}} 
\index{nntrainer::RunLayerContext@{nntrainer::RunLayerContext}!setBatch@{setBatch}}
\index{setBatch@{setBatch}!nntrainer::RunLayerContext@{nntrainer::RunLayerContext}}
\doxysubsubsection{\texorpdfstring{setBatch()}{setBatch()}}
{\footnotesize\ttfamily void nntrainer\+::\+Run\+Layer\+Context\+::set\+Batch (\begin{DoxyParamCaption}\item[{unsigned int}]{batch }\end{DoxyParamCaption})}



Set the batch for the run context. 


\begin{DoxyParams}{Parameters}
{\em batch} & Update batch size \\
\hline
\end{DoxyParams}


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

\mbox{\Hypertarget{classnntrainer_1_1RunLayerContext_af2203609a385e64ac78dcef57b4f233b}\label{classnntrainer_1_1RunLayerContext_af2203609a385e64ac78dcef57b4f233b}} 
\index{nntrainer::RunLayerContext@{nntrainer::RunLayerContext}!setLoss@{setLoss}}
\index{setLoss@{setLoss}!nntrainer::RunLayerContext@{nntrainer::RunLayerContext}}
\doxysubsubsection{\texorpdfstring{setLoss()}{setLoss()}}
{\footnotesize\ttfamily void nntrainer\+::\+Run\+Layer\+Context\+::set\+Loss (\begin{DoxyParamCaption}\item[{float}]{val }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



update loss by the layer 


\begin{DoxyParams}{Parameters}
{\em val} & updated loss value \\
\hline
\end{DoxyParams}
\begin{DoxyNote}{Note}
loss value is only used for loss layers. For non-\/loss layers, setting this value will have no change on the behavior of the model. 
\end{DoxyNote}


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

\mbox{\Hypertarget{classnntrainer_1_1RunLayerContext_a87ccbba7d676ecb539764d8c32b823bd}\label{classnntrainer_1_1RunLayerContext_a87ccbba7d676ecb539764d8c32b823bd}} 
\index{nntrainer::RunLayerContext@{nntrainer::RunLayerContext}!tensorHasGradient@{tensorHasGradient}}
\index{tensorHasGradient@{tensorHasGradient}!nntrainer::RunLayerContext@{nntrainer::RunLayerContext}}
\doxysubsubsection{\texorpdfstring{tensorHasGradient()}{tensorHasGradient()}}
{\footnotesize\ttfamily bool nntrainer\+::\+Run\+Layer\+Context\+::tensor\+Has\+Gradient (\begin{DoxyParamCaption}\item[{unsigned int}]{idx }\end{DoxyParamCaption}) const}



check if the tensor has gradient 


\begin{DoxyParams}{Parameters}
{\em idx} & Identifier of the tensor \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true if tensor has gradient, else false 
\end{DoxyReturn}


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

\mbox{\Hypertarget{classnntrainer_1_1RunLayerContext_a9d5896e806f780b576e0fb765b40097a}\label{classnntrainer_1_1RunLayerContext_a9d5896e806f780b576e0fb765b40097a}} 
\index{nntrainer::RunLayerContext@{nntrainer::RunLayerContext}!updateTensor@{updateTensor}}
\index{updateTensor@{updateTensor}!nntrainer::RunLayerContext@{nntrainer::RunLayerContext}}
\doxysubsubsection{\texorpdfstring{updateTensor()}{updateTensor()}}
{\footnotesize\ttfamily void nntrainer\+::\+Run\+Layer\+Context\+::update\+Tensor (\begin{DoxyParamCaption}\item[{unsigned int}]{idx,  }\item[{unsigned int}]{batch }\end{DoxyParamCaption})}



Update the dimensions for a requested tensor. 


\begin{DoxyParams}{Parameters}
{\em idx} & index of the tensor (identifier) \\
\hline
{\em batch} & Updated batch size \\
\hline
\end{DoxyParams}


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

\mbox{\Hypertarget{classnntrainer_1_1RunLayerContext_abd132539e70ee4f7c1c264621987ee8e}\label{classnntrainer_1_1RunLayerContext_abd132539e70ee4f7c1c264621987ee8e}} 
\index{nntrainer::RunLayerContext@{nntrainer::RunLayerContext}!validate@{validate}}
\index{validate@{validate}!nntrainer::RunLayerContext@{nntrainer::RunLayerContext}}
\doxysubsubsection{\texorpdfstring{validate()}{validate()}}
{\footnotesize\ttfamily bool nntrainer\+::\+Run\+Layer\+Context\+::validate (\begin{DoxyParamCaption}\item[{bool}]{skip\+\_\+input = {\ttfamily false},  }\item[{bool}]{skip\+\_\+label = {\ttfamily false} }\end{DoxyParamCaption})}



validates the run context after run 


\begin{DoxyParams}{Parameters}
{\em skip\+\_\+input} & skip verifying the input \\
\hline
{\em skip\+\_\+label} & skip verifying the label\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true if ready, else false

true if ready, else false 
\end{DoxyReturn}
\begin{DoxyNote}{Note}
a common mistake when using run\+\_\+context is re-\/assigning the tensor references which leads to nasty bugs. This validation ensures that the tensors are not set mistakenly by verifying their unique names
\end{DoxyNote}


Definition at line 489 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_1RunLayerContext_abd132539e70ee4f7c1c264621987ee8e_cgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{classnntrainer_1_1RunLayerContext_abc5a61d5bc44827d6860324e2a30e8f1}\label{classnntrainer_1_1RunLayerContext_abc5a61d5bc44827d6860324e2a30e8f1}} 
\index{nntrainer::RunLayerContext@{nntrainer::RunLayerContext}!weightHasGradient@{weightHasGradient}}
\index{weightHasGradient@{weightHasGradient}!nntrainer::RunLayerContext@{nntrainer::RunLayerContext}}
\doxysubsubsection{\texorpdfstring{weightHasGradient()}{weightHasGradient()}}
{\footnotesize\ttfamily bool nntrainer\+::\+Run\+Layer\+Context\+::weight\+Has\+Gradient (\begin{DoxyParamCaption}\item[{unsigned int}]{idx }\end{DoxyParamCaption}) const}



check if the weight has gradient 


\begin{DoxyParams}{Parameters}
{\em idx} & Identifier of the weight \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true if weight has gradient, else false 
\end{DoxyReturn}


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



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}
