\hypertarget{classnntrainer_1_1MemoryPlanner}{}\doxysection{nntrainer\+::Memory\+Planner Class Reference}
\label{classnntrainer_1_1MemoryPlanner}\index{nntrainer::MemoryPlanner@{nntrainer::MemoryPlanner}}


Memory Planner provides the plan/strategy to allocate the memory.  




{\ttfamily \#include $<$memory\+\_\+planner.\+h$>$}



Inheritance diagram for nntrainer\+::Memory\+Planner\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classnntrainer_1_1MemoryPlanner__inherit__graph}
\end{center}
\end{figure}
\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
virtual \mbox{\hyperlink{classnntrainer_1_1MemoryPlanner_a1287a169f9a34a8471f56a91d68445e1}{$\sim$\+Memory\+Planner}} ()=default
\begin{DoxyCompactList}\small\item\em \mbox{\hyperlink{classnntrainer_1_1MemoryPlanner}{Memory\+Planner}} destructor. \end{DoxyCompactList}\item 
virtual size\+\_\+t \mbox{\hyperlink{classnntrainer_1_1MemoryPlanner_a9bc7139a759929d7d1323243bbdeefaa}{plan\+Layout}} (const std\+::vector$<$ size\+\_\+t $>$ \&memory\+\_\+size, const std\+::vector$<$ std\+::pair$<$ unsigned int, unsigned int $>$$>$ \&memory\+\_\+validity, std\+::vector$<$ size\+\_\+t $>$ \&memory\+\_\+offset, std\+::vector$<$ bool $>$ \&memory\+\_\+is\+\_\+wgrad, size\+\_\+t n\+\_\+wgrad) const =0
\begin{DoxyCompactList}\small\item\em Plan the layout for the memory allocation. \end{DoxyCompactList}\item 
virtual const std\+::string \& \mbox{\hyperlink{classnntrainer_1_1MemoryPlanner_a7b35b512d91d9d3afb5f2cc8c2bdbecd}{get\+Type}} () const =0
\begin{DoxyCompactList}\small\item\em Get type of the planner. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Memory Planner provides the plan/strategy to allocate the memory. 

Definition at line 26 of file memory\+\_\+planner.\+h.



\doxysubsection{Constructor \& Destructor Documentation}
\mbox{\Hypertarget{classnntrainer_1_1MemoryPlanner_a1287a169f9a34a8471f56a91d68445e1}\label{classnntrainer_1_1MemoryPlanner_a1287a169f9a34a8471f56a91d68445e1}} 
\index{nntrainer::MemoryPlanner@{nntrainer::MemoryPlanner}!````~MemoryPlanner@{$\sim$MemoryPlanner}}
\index{````~MemoryPlanner@{$\sim$MemoryPlanner}!nntrainer::MemoryPlanner@{nntrainer::MemoryPlanner}}
\doxysubsubsection{\texorpdfstring{$\sim$MemoryPlanner()}{~MemoryPlanner()}}
{\footnotesize\ttfamily virtual nntrainer\+::\+Memory\+Planner\+::$\sim$\+Memory\+Planner (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [virtual]}, {\ttfamily [default]}}



\mbox{\hyperlink{classnntrainer_1_1MemoryPlanner}{Memory\+Planner}} destructor. 



\doxysubsection{Member Function Documentation}
\mbox{\Hypertarget{classnntrainer_1_1MemoryPlanner_a7b35b512d91d9d3afb5f2cc8c2bdbecd}\label{classnntrainer_1_1MemoryPlanner_a7b35b512d91d9d3afb5f2cc8c2bdbecd}} 
\index{nntrainer::MemoryPlanner@{nntrainer::MemoryPlanner}!getType@{getType}}
\index{getType@{getType}!nntrainer::MemoryPlanner@{nntrainer::MemoryPlanner}}
\doxysubsubsection{\texorpdfstring{getType()}{getType()}}
{\footnotesize\ttfamily virtual const std\+::string\& nntrainer\+::\+Memory\+Planner\+::get\+Type (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [pure virtual]}}



Get type of the planner. 

\begin{DoxyReturn}{Returns}
The type of the planner 
\end{DoxyReturn}


Implemented in \mbox{\hyperlink{classnntrainer_1_1OptimizedV2Planner_a357772f85388d8b9bcf6c345e2eae8ec}{nntrainer\+::\+Optimized\+V2\+Planner}}, \mbox{\hyperlink{classnntrainer_1_1OptimizedV1Planner_ad966fd257554969a1375c9ea47aa1f87}{nntrainer\+::\+Optimized\+V1\+Planner}}, \mbox{\hyperlink{classnntrainer_1_1OptimizedV3Planner_a87abc198c7bfaa9292cd72d1d8fd80bc}{nntrainer\+::\+Optimized\+V3\+Planner}}, and \mbox{\hyperlink{classnntrainer_1_1BasicPlanner_a92167624746e36c43e95965ea9073730}{nntrainer\+::\+Basic\+Planner}}.

\mbox{\Hypertarget{classnntrainer_1_1MemoryPlanner_a9bc7139a759929d7d1323243bbdeefaa}\label{classnntrainer_1_1MemoryPlanner_a9bc7139a759929d7d1323243bbdeefaa}} 
\index{nntrainer::MemoryPlanner@{nntrainer::MemoryPlanner}!planLayout@{planLayout}}
\index{planLayout@{planLayout}!nntrainer::MemoryPlanner@{nntrainer::MemoryPlanner}}
\doxysubsubsection{\texorpdfstring{planLayout()}{planLayout()}}
{\footnotesize\ttfamily virtual size\+\_\+t nntrainer\+::\+Memory\+Planner\+::plan\+Layout (\begin{DoxyParamCaption}\item[{const std\+::vector$<$ size\+\_\+t $>$ \&}]{memory\+\_\+size,  }\item[{const std\+::vector$<$ std\+::pair$<$ unsigned int, unsigned int $>$$>$ \&}]{memory\+\_\+validity,  }\item[{std\+::vector$<$ size\+\_\+t $>$ \&}]{memory\+\_\+offset,  }\item[{std\+::vector$<$ bool $>$ \&}]{memory\+\_\+is\+\_\+wgrad,  }\item[{size\+\_\+t}]{n\+\_\+wgrad }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [pure virtual]}}



Plan the layout for the memory allocation. 


\begin{DoxyParams}[1]{Parameters}
\mbox{\texttt{ in}}  & {\em memory\+\_\+size} & The size of the various memories \\
\hline
\mbox{\texttt{ in}}  & {\em memory\+\_\+validity} & The validity of the various memories \\
\hline
\mbox{\texttt{ out}}  & {\em memory\+\_\+offset} & The offset of each memory from the base of the allocated memory \\
\hline
\mbox{\texttt{ in}}  & {\em memory\+\_\+is\+\_\+wgrad} & The index for identification of weight gradient \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The total memory required as per this strategy
\end{DoxyReturn}
The minimum offset will be 0, and the maximum offset will be less than the sum of the memory\+\_\+size vector. 

Implemented in \mbox{\hyperlink{classnntrainer_1_1OptimizedV2Planner_a89ddd97e1405978989c85c50d53e27c6}{nntrainer\+::\+Optimized\+V2\+Planner}}, \mbox{\hyperlink{classnntrainer_1_1OptimizedV1Planner_aa1048051223efa379ab346561fad9473}{nntrainer\+::\+Optimized\+V1\+Planner}}, \mbox{\hyperlink{classnntrainer_1_1OptimizedV3Planner_af56d882bbdb84eaf50bd2f526f5ee505}{nntrainer\+::\+Optimized\+V3\+Planner}}, and \mbox{\hyperlink{classnntrainer_1_1BasicPlanner_a61551aa02c900b0d3127dd6e2b90f307}{nntrainer\+::\+Basic\+Planner}}.

Here is the caller graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{classnntrainer_1_1MemoryPlanner_a9bc7139a759929d7d1323243bbdeefaa_icgraph}
\end{center}
\end{figure}


The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
tensor/\mbox{\hyperlink{memory__planner_8h}{memory\+\_\+planner.\+h}}\end{DoxyCompactItemize}
