\hypertarget{tensor_8cpp}{}\doxysection{tensor/tensor.cpp File Reference}
\label{tensor_8cpp}\index{tensor/tensor.cpp@{tensor/tensor.cpp}}


This is Tensor class for calculation.  


{\ttfamily \#include $<$algorithm$>$}\newline
{\ttfamily \#include $<$assert.\+h$>$}\newline
{\ttfamily \#include $<$cmath$>$}\newline
{\ttfamily \#include $<$cstring$>$}\newline
{\ttfamily \#include $<$fstream$>$}\newline
{\ttfamily \#include $<$iomanip$>$}\newline
{\ttfamily \#include $<$iostream$>$}\newline
{\ttfamily \#include $<$iterator$>$}\newline
{\ttfamily \#include $<$numeric$>$}\newline
{\ttfamily \#include $<$random$>$}\newline
{\ttfamily \#include $<$regex$>$}\newline
{\ttfamily \#include $<$sstream$>$}\newline
{\ttfamily \#include $<$stdexcept$>$}\newline
{\ttfamily \#include $<$stdio.\+h$>$}\newline
{\ttfamily \#include $<$blas\+\_\+interface.\+h$>$}\newline
{\ttfamily \#include $<$lazy\+\_\+tensor.\+h$>$}\newline
{\ttfamily \#include $<$nntrainer\+\_\+error.\+h$>$}\newline
{\ttfamily \#include $<$nntrainer\+\_\+log.\+h$>$}\newline
{\ttfamily \#include $<$tensor.\+h$>$}\newline
{\ttfamily \#include $<$util\+\_\+func.\+h$>$}\newline
Include dependency graph for tensor.\+cpp\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{tensor_8cpp__incl}
\end{center}
\end{figure}
\doxysubsection*{Classes}
\begin{DoxyCompactItemize}
\item 
struct \mbox{\hyperlink{structnntrainer_1_1Tensor_1_1BroadcastInfo}{nntrainer\+::\+Tensor\+::\+Broadcast\+Info}}
\item 
class \mbox{\hyperlink{classnntrainer_1_1SrcSharedTensor}{nntrainer\+::\+Src\+Shared\+Tensor}}
\begin{DoxyCompactList}\small\item\em Source of the shared tensor. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsection*{Namespaces}
\begin{DoxyCompactItemize}
\item 
 \mbox{\hyperlink{namespacenntrainer}{nntrainer}}
\end{DoxyCompactItemize}
\doxysubsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define {\bfseries transposeloop}(cl,  ci,  cj,  ck,  sl,  si,  sj,  sk)
\item 
\#define {\bfseries C\+R\+E\+A\+T\+E\+\_\+\+I\+F\+\_\+\+E\+M\+P\+T\+Y\+\_\+\+D\+I\+MS}(tensor, ...)
\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{namespacenntrainer_a9fc37c9d77b9c8b81b68dcc571e76cdc}\label{namespacenntrainer_a9fc37c9d77b9c8b81b68dcc571e76cdc}} 
std\+::ostream \& {\bfseries nntrainer\+::operator$<$$<$} (std\+::ostream \&out, Tensor const \&m)
\end{DoxyCompactItemize}
\doxysubsection*{Variables}
\begin{DoxyCompactItemize}
\item 
static auto {\bfseries nntrainer\+::rng}
\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
This is Tensor class for calculation. 

Copyright (C) 2019 Samsung Electronics Co., Ltd. All Rights Reserved.

Licensed under the Apache License, Version 2.\+0 (the \char`\"{}\+License\char`\"{}); you may not use this file except in compliance with the License. You may obtain a copy of the License at \href{http://www.apache.org/licenses/LICENSE-2.0}{\texttt{ http\+://www.\+apache.\+org/licenses/\+L\+I\+C\+E\+N\+S\+E-\/2.\+0}} Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \char`\"{}\+A\+S I\+S\char`\"{} B\+A\+S\+IS, W\+I\+T\+H\+O\+UT W\+A\+R\+R\+A\+N\+T\+I\+ES OR C\+O\+N\+D\+I\+T\+I\+O\+NS OF A\+NY K\+I\+ND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

\begin{DoxyDate}{Date}
04 December 2019 
\end{DoxyDate}
\begin{DoxySeeAlso}{See also}
\href{https://github.com/nnstreamer/nntrainer}{\texttt{ https\+://github.\+com/nnstreamer/nntrainer}} 
\end{DoxySeeAlso}
\begin{DoxyAuthor}{Author}
Jijoong Moon \href{mailto:jijoong.moon@samsung.com}{\texttt{ jijoong.\+moon@samsung.\+com}} 
\end{DoxyAuthor}
\begin{DoxyRefDesc}{Bug}
\item[\mbox{\hyperlink{bug__bug000224}{Bug}}]No known bugs except for N\+YI items\end{DoxyRefDesc}


\doxysubsection{Macro Definition Documentation}
\mbox{\Hypertarget{tensor_8cpp_a6241fd26b65cb861f0b9cb9a97d01666}\label{tensor_8cpp_a6241fd26b65cb861f0b9cb9a97d01666}} 
\index{tensor.cpp@{tensor.cpp}!CREATE\_IF\_EMPTY\_DIMS@{CREATE\_IF\_EMPTY\_DIMS}}
\index{CREATE\_IF\_EMPTY\_DIMS@{CREATE\_IF\_EMPTY\_DIMS}!tensor.cpp@{tensor.cpp}}
\doxysubsubsection{\texorpdfstring{CREATE\_IF\_EMPTY\_DIMS}{CREATE\_IF\_EMPTY\_DIMS}}
{\footnotesize\ttfamily \#define C\+R\+E\+A\+T\+E\+\_\+\+I\+F\+\_\+\+E\+M\+P\+T\+Y\+\_\+\+D\+I\+MS(\begin{DoxyParamCaption}\item[{}]{tensor,  }\item[{}]{... }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{  \textcolor{keywordflow}{do} \{                                    \(\backslash\)}
\DoxyCodeLine{    if (tensor.empty())                   \(\backslash\)}
\DoxyCodeLine{      tensor = Tensor(\_\_VA\_ARGS\_\_);       \(\backslash\)}
\DoxyCodeLine{  \} \textcolor{keywordflow}{while} (0);}

\end{DoxyCode}


Definition at line 60 of file tensor.\+cpp.

\mbox{\Hypertarget{tensor_8cpp_a77511061a64d9c1b1f879e69f4809f8c}\label{tensor_8cpp_a77511061a64d9c1b1f879e69f4809f8c}} 
\index{tensor.cpp@{tensor.cpp}!transposeloop@{transposeloop}}
\index{transposeloop@{transposeloop}!tensor.cpp@{tensor.cpp}}
\doxysubsubsection{\texorpdfstring{transposeloop}{transposeloop}}
{\footnotesize\ttfamily \#define transposeloop(\begin{DoxyParamCaption}\item[{}]{cl,  }\item[{}]{ci,  }\item[{}]{cj,  }\item[{}]{ck,  }\item[{}]{sl,  }\item[{}]{si,  }\item[{}]{sj,  }\item[{}]{sk }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{  \textcolor{keywordflow}{do} \{                                                                \(\backslash\)}
\DoxyCodeLine{    unsigned \textcolor{keywordtype}{int} i, j, k, l;                                          \(\backslash\)}
\DoxyCodeLine{    int inidx = 0, outidx = 0;                                        \(\backslash\)}
\DoxyCodeLine{    for (cl = 0; cl < sl; cl++)                                       \(\backslash\)}
\DoxyCodeLine{      \textcolor{keywordflow}{for} (ci = 0; ci < si; ci++)                                     \(\backslash\)}
\DoxyCodeLine{        \textcolor{keywordflow}{for} (cj = 0; cj < sj; cj++)                                   \(\backslash\)}
\DoxyCodeLine{          \textcolor{keywordflow}{for} (ck = 0; ck < sk; ck++) \{                               \(\backslash\)}
\DoxyCodeLine{            outidx = si * sj * sk * cl + sj * sk * ci + sk * cj + ck; \(\backslash\)}
\DoxyCodeLine{            inidx = l * SI * SJ * SK + i * SJ * SK + j * SK + k;      \(\backslash\)}
\DoxyCodeLine{            outptr[outidx] = inptr[inidx];                            \(\backslash\)}
\DoxyCodeLine{          \}                                                           \(\backslash\)}
\DoxyCodeLine{  \} \textcolor{keywordflow}{while} (0);}

\end{DoxyCode}


Definition at line 46 of file tensor.\+cpp.

