\hypertarget{tensor__data_8c}{}\doxysection{nnstreamer/tensor\+\_\+data.c File Reference}
\label{tensor__data_8c}\index{nnstreamer/tensor\_data.c@{nnstreamer/tensor\_data.c}}


Internal functions to handle various tensor type and value.  


{\ttfamily \#include $<$math.\+h$>$}\newline
{\ttfamily \#include \char`\"{}tensor\+\_\+data.\+h\char`\"{}}\newline
{\ttfamily \#include \char`\"{}nnstreamer\+\_\+log.\+h\char`\"{}}\newline
{\ttfamily \#include \char`\"{}nnstreamer\+\_\+plugin\+\_\+api.\+h\char`\"{}}\newline
Include dependency graph for tensor\+\_\+data.\+c\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{tensor__data_8c__incl}
\end{center}
\end{figure}
\doxysubsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \mbox{\hyperlink{tensor__data_8c_ab83d2a5778ee455808cdec7195d053f9}{td\+\_\+set\+\_\+data}}(td,  v,  dtype)
\begin{DoxyCompactList}\small\item\em Macro to set data in struct. \end{DoxyCompactList}\item 
\#define \mbox{\hyperlink{tensor__data_8c_ae59f7d3ded0ab4c7d87d1e9740d9bd24}{td\+\_\+get\+\_\+data}}(td,  v,  dtype)
\item 
\#define \mbox{\hyperlink{tensor__data_8c_a2f04f2179cc278172e458077ca67cd8a}{td\+\_\+typecast\+\_\+to}}(td,  itype,  otype)
\item 
\#define \mbox{\hyperlink{tensor__data_8c_aca06d17207971a5f28c2cff576ba7f77}{td\+\_\+typecast\+\_\+to\+\_\+fromf16}}(td,  itype)
\item 
\#define \mbox{\hyperlink{tensor__data_8c_ad7df3a9f7376918e7736e15ebc9610e9}{td\+\_\+typecast}}(td,  otype)
\end{DoxyCompactItemize}
\doxysubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{tensor__data_8c_a8ca9996595b367352d5665c3ee092ffa}{while}} (0)
\begin{DoxyCompactList}\small\item\em dtype = $\ast$((dtype $\ast$) v); \textbackslash{} \end{DoxyCompactList}\item 
gboolean \mbox{\hyperlink{tensor__data_8c_a4de1a130d54d3afe078e655d58ba1e20}{gst\+\_\+tensor\+\_\+data\+\_\+get}} (\mbox{\hyperlink{structtensor__data__s}{tensor\+\_\+data\+\_\+s}} $\ast$td, gpointer value)
\begin{DoxyCompactList}\small\item\em Get tensor element value. \end{DoxyCompactList}\item 
gboolean \mbox{\hyperlink{tensor__data_8c_a46a370094cb45ebbbf8b591e908abf7d}{gst\+\_\+tensor\+\_\+data\+\_\+typecast}} (\mbox{\hyperlink{structtensor__data__s}{tensor\+\_\+data\+\_\+s}} $\ast$td, \mbox{\hyperlink{tensor__typedef_8h_ab5f7feb87196d0b9ae37b11fd819f23e}{tensor\+\_\+type}} \mbox{\hyperlink{gsttensor__if_8c_ae3c4ba0b643db0fa0b5b96496abd1803}{type}})
\begin{DoxyCompactList}\small\item\em Typecast tensor element data. \end{DoxyCompactList}\item 
gboolean \mbox{\hyperlink{tensor__data_8c_a19e19448fcbdd10d056c03d29a14dd38}{gst\+\_\+tensor\+\_\+data\+\_\+raw\+\_\+typecast}} (gpointer input, \mbox{\hyperlink{tensor__typedef_8h_ab5f7feb87196d0b9ae37b11fd819f23e}{tensor\+\_\+type}} in\+\_\+type, gpointer output, \mbox{\hyperlink{tensor__typedef_8h_ab5f7feb87196d0b9ae37b11fd819f23e}{tensor\+\_\+type}} out\+\_\+type)
\begin{DoxyCompactList}\small\item\em Typecast tensor element value. \end{DoxyCompactList}\item 
gboolean \mbox{\hyperlink{tensor__data_8c_a55e1dc3156e118d586f262e90dfa4483}{gst\+\_\+tensor\+\_\+data\+\_\+raw\+\_\+average}} (gpointer raw, gsize length, \mbox{\hyperlink{tensor__typedef_8h_ab5f7feb87196d0b9ae37b11fd819f23e}{tensor\+\_\+type}} \mbox{\hyperlink{gsttensor__if_8c_ae3c4ba0b643db0fa0b5b96496abd1803}{type}}, gdouble $\ast$$\ast$\mbox{\hyperlink{gsttensor__if_8c_a13a9f04759a6e91867ba9c6301c61326}{result}})
\begin{DoxyCompactList}\small\item\em Calculate average value of the tensor. \end{DoxyCompactList}\item 
gboolean \mbox{\hyperlink{tensor__data_8c_aae7c3dbd38e2214bb52d4f48c334c992}{gst\+\_\+tensor\+\_\+data\+\_\+raw\+\_\+average\+\_\+per\+\_\+channel}} (gpointer raw, gsize length, \mbox{\hyperlink{tensor__typedef_8h_ab5f7feb87196d0b9ae37b11fd819f23e}{tensor\+\_\+type}} \mbox{\hyperlink{gsttensor__if_8c_ae3c4ba0b643db0fa0b5b96496abd1803}{type}}, \mbox{\hyperlink{tensor__typedef_8h_ae58ce2b6d47c4a2e9c5f3f621c6a5b9a}{tensor\+\_\+dim}} dim, gdouble $\ast$$\ast$results)
\begin{DoxyCompactList}\small\item\em Calculate average value of the tensor per channel (the first dim). \end{DoxyCompactList}\item 
gboolean \mbox{\hyperlink{tensor__data_8c_a95a28ea109ce9757a7a9b69196a820f7}{gst\+\_\+tensor\+\_\+data\+\_\+raw\+\_\+std}} (gpointer raw, gsize length, \mbox{\hyperlink{tensor__typedef_8h_ab5f7feb87196d0b9ae37b11fd819f23e}{tensor\+\_\+type}} \mbox{\hyperlink{gsttensor__if_8c_ae3c4ba0b643db0fa0b5b96496abd1803}{type}}, gdouble $\ast$average, gdouble $\ast$$\ast$\mbox{\hyperlink{gsttensor__if_8c_a13a9f04759a6e91867ba9c6301c61326}{result}})
\begin{DoxyCompactList}\small\item\em Calculate standard deviation of the tensor. \end{DoxyCompactList}\item 
gboolean \mbox{\hyperlink{tensor__data_8c_ae5da97dddbdf99c3056086431f486710}{gst\+\_\+tensor\+\_\+data\+\_\+raw\+\_\+std\+\_\+per\+\_\+channel}} (gpointer raw, gsize length, \mbox{\hyperlink{tensor__typedef_8h_ab5f7feb87196d0b9ae37b11fd819f23e}{tensor\+\_\+type}} \mbox{\hyperlink{gsttensor__if_8c_ae3c4ba0b643db0fa0b5b96496abd1803}{type}}, \mbox{\hyperlink{tensor__typedef_8h_ae58ce2b6d47c4a2e9c5f3f621c6a5b9a}{tensor\+\_\+dim}} dim, gdouble $\ast$averages, gdouble $\ast$$\ast$results)
\begin{DoxyCompactList}\small\item\em Calculate standard deviation of the tensor per channel (the first dim). \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Internal functions to handle various tensor type and value. 

Copyright (c) 2021 Samsung Electronics Co., Ltd. All Rights Reserved.

\begin{DoxyDate}{Date}
10 Mar 2021 
\end{DoxyDate}
\begin{DoxySeeAlso}{See also}
\href{http://github.com/nnstreamer/nnstreamer}{\texttt{ http\+://github.\+com/nnstreamer/nnstreamer}} 
\end{DoxySeeAlso}
\begin{DoxyAuthor}{Author}
Jaeyun Jung \href{mailto:jy1210.jung@samsung.com}{\texttt{ jy1210.\+jung@samsung.\+com}} 
\end{DoxyAuthor}
\begin{DoxyRefDesc}{Bug}
\item[\mbox{\hyperlink{bug__bug000101}{Bug}}]No known bugs except for N\+YI items \end{DoxyRefDesc}


\doxysubsection{Macro Definition Documentation}
\mbox{\Hypertarget{tensor__data_8c_ae59f7d3ded0ab4c7d87d1e9740d9bd24}\label{tensor__data_8c_ae59f7d3ded0ab4c7d87d1e9740d9bd24}} 
\index{tensor\_data.c@{tensor\_data.c}!td\_get\_data@{td\_get\_data}}
\index{td\_get\_data@{td\_get\_data}!tensor\_data.c@{tensor\_data.c}}
\doxysubsubsection{\texorpdfstring{td\_get\_data}{td\_get\_data}}
{\footnotesize\ttfamily \#define td\+\_\+get\+\_\+data(\begin{DoxyParamCaption}\item[{}]{td,  }\item[{}]{v,  }\item[{}]{dtype }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{    \textcolor{keywordflow}{do} \{ \(\backslash\)}
\DoxyCodeLine{    *((dtype *) v) = (td)-\/>\mbox{\hyperlink{gsttensor__if_8c_a3c9cc8d6e8da85fef51da4c7115b97f6}{data}}.\_}

\end{DoxyCode}
\mbox{\Hypertarget{tensor__data_8c_ab83d2a5778ee455808cdec7195d053f9}\label{tensor__data_8c_ab83d2a5778ee455808cdec7195d053f9}} 
\index{tensor\_data.c@{tensor\_data.c}!td\_set\_data@{td\_set\_data}}
\index{td\_set\_data@{td\_set\_data}!tensor\_data.c@{tensor\_data.c}}
\doxysubsubsection{\texorpdfstring{td\_set\_data}{td\_set\_data}}
{\footnotesize\ttfamily \#define td\+\_\+set\+\_\+data(\begin{DoxyParamCaption}\item[{}]{td,  }\item[{}]{v,  }\item[{}]{dtype }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{    \textcolor{keywordflow}{do} \{ \(\backslash\)}
\DoxyCodeLine{    (td)-\/>\mbox{\hyperlink{gsttensor__if_8c_a3c9cc8d6e8da85fef51da4c7115b97f6}{data}}.\_}

\end{DoxyCode}


Macro to set data in struct. 



Definition at line 21 of file tensor\+\_\+data.\+c.

\mbox{\Hypertarget{tensor__data_8c_ad7df3a9f7376918e7736e15ebc9610e9}\label{tensor__data_8c_ad7df3a9f7376918e7736e15ebc9610e9}} 
\index{tensor\_data.c@{tensor\_data.c}!td\_typecast@{td\_typecast}}
\index{td\_typecast@{td\_typecast}!tensor\_data.c@{tensor\_data.c}}
\doxysubsubsection{\texorpdfstring{td\_typecast}{td\_typecast}}
{\footnotesize\ttfamily \#define td\+\_\+typecast(\begin{DoxyParamCaption}\item[{}]{td,  }\item[{}]{otype }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{    \textcolor{keywordflow}{do} \{ \(\backslash\)}
\DoxyCodeLine{    switch ((td)-\/>\mbox{\hyperlink{gsttensor__if_8c_ae3c4ba0b643db0fa0b5b96496abd1803}{type}}) \{ \(\backslash\)}
\DoxyCodeLine{      case \mbox{\hyperlink{tensor__typedef_8h_a85f1ee57f40a96f8684f79bac501b0eaa049f2d9061ce255f95765dc03e37983d}{\_NNS\_INT32}}: \mbox{\hyperlink{tensor__data_8c_a2f04f2179cc278172e458077ca67cd8a}{td\_typecast\_to}} (td, int32\_t, otype); \textcolor{keywordflow}{break}; \(\backslash\)}
\DoxyCodeLine{      case \mbox{\hyperlink{tensor__typedef_8h_a85f1ee57f40a96f8684f79bac501b0eaaf63d9ea8926a1befebc780fdfcc21eb9}{\_NNS\_UINT32}}: \mbox{\hyperlink{tensor__data_8c_a2f04f2179cc278172e458077ca67cd8a}{td\_typecast\_to}} (td, uint32\_t, otype); \textcolor{keywordflow}{break}; \(\backslash\)}
\DoxyCodeLine{      case \mbox{\hyperlink{tensor__typedef_8h_a85f1ee57f40a96f8684f79bac501b0eaacbeb809f942df58e669c3a2f3d986a9f}{\_NNS\_INT16}}: \mbox{\hyperlink{tensor__data_8c_a2f04f2179cc278172e458077ca67cd8a}{td\_typecast\_to}} (td, int16\_t, otype); \textcolor{keywordflow}{break}; \(\backslash\)}
\DoxyCodeLine{      case \mbox{\hyperlink{tensor__typedef_8h_a85f1ee57f40a96f8684f79bac501b0eaa43de6043203de583de60208e49183401}{\_NNS\_UINT16}}:  \mbox{\hyperlink{tensor__data_8c_a2f04f2179cc278172e458077ca67cd8a}{td\_typecast\_to}} (td, uint16\_t, otype); \textcolor{keywordflow}{break}; \(\backslash\)}
\DoxyCodeLine{      case \mbox{\hyperlink{tensor__typedef_8h_a85f1ee57f40a96f8684f79bac501b0eaa5380abf91df5c82187018ac4d24279e2}{\_NNS\_INT8}}: \mbox{\hyperlink{tensor__data_8c_a2f04f2179cc278172e458077ca67cd8a}{td\_typecast\_to}} (td, int8\_t, otype); \textcolor{keywordflow}{break}; \(\backslash\)}
\DoxyCodeLine{      case \mbox{\hyperlink{tensor__typedef_8h_a85f1ee57f40a96f8684f79bac501b0eaab5a59c21ae9c9ec4b02b363c0e176939}{\_NNS\_UINT8}}: \mbox{\hyperlink{tensor__data_8c_a2f04f2179cc278172e458077ca67cd8a}{td\_typecast\_to}} (td, uint8\_t, otype); \textcolor{keywordflow}{break}; \(\backslash\)}
\DoxyCodeLine{      case \mbox{\hyperlink{tensor__typedef_8h_a85f1ee57f40a96f8684f79bac501b0eaa34b59a484c1243f2d9526a158e5417c2}{\_NNS\_FLOAT64}}: \mbox{\hyperlink{tensor__data_8c_a2f04f2179cc278172e458077ca67cd8a}{td\_typecast\_to}} (td, \textcolor{keywordtype}{double}, otype); \textcolor{keywordflow}{break}; \(\backslash\)}
\DoxyCodeLine{      case \mbox{\hyperlink{tensor__typedef_8h_a85f1ee57f40a96f8684f79bac501b0eaab5c2db8009a13383684358501ff4cc48}{\_NNS\_FLOAT32}}: \mbox{\hyperlink{tensor__data_8c_a2f04f2179cc278172e458077ca67cd8a}{td\_typecast\_to}} (td, \textcolor{keywordtype}{float}, otype); \textcolor{keywordflow}{break}; \(\backslash\)}
\DoxyCodeLine{      case \mbox{\hyperlink{tensor__typedef_8h_a85f1ee57f40a96f8684f79bac501b0eaafc37d7435087f9661f8aaf75049e5cc4}{\_NNS\_FLOAT16}}: \mbox{\hyperlink{tensor__data_8c_aca06d17207971a5f28c2cff576ba7f77}{td\_typecast\_to\_fromf16}} (td, otype); \textcolor{keywordflow}{break}; \(\backslash\)}
\DoxyCodeLine{      case \mbox{\hyperlink{tensor__typedef_8h_a85f1ee57f40a96f8684f79bac501b0eaa93b0749871b9b80e3af17e74dcef9452}{\_NNS\_INT64}}: \mbox{\hyperlink{tensor__data_8c_a2f04f2179cc278172e458077ca67cd8a}{td\_typecast\_to}} (td, int64\_t, otype); \textcolor{keywordflow}{break}; \(\backslash\)}
\DoxyCodeLine{      case \mbox{\hyperlink{tensor__typedef_8h_a85f1ee57f40a96f8684f79bac501b0eaa7045bb742c618911841b17112fdd2d0b}{\_NNS\_UINT64}}: \mbox{\hyperlink{tensor__data_8c_a2f04f2179cc278172e458077ca67cd8a}{td\_typecast\_to}} (td, uint64\_t, otype); \textcolor{keywordflow}{break}; \(\backslash\)}
\DoxyCodeLine{      default: \mbox{\hyperlink{gsttensor__srciio_8c_adc3c53abec02288da58747d5a1eb3ab4}{g\_assert}} (0); \textcolor{keywordflow}{break}; \(\backslash\)}
\DoxyCodeLine{    \} \(\backslash\)}
\DoxyCodeLine{  \} \textcolor{keywordflow}{while} (0)}

\end{DoxyCode}
\mbox{\Hypertarget{tensor__data_8c_a2f04f2179cc278172e458077ca67cd8a}\label{tensor__data_8c_a2f04f2179cc278172e458077ca67cd8a}} 
\index{tensor\_data.c@{tensor\_data.c}!td\_typecast\_to@{td\_typecast\_to}}
\index{td\_typecast\_to@{td\_typecast\_to}!tensor\_data.c@{tensor\_data.c}}
\doxysubsubsection{\texorpdfstring{td\_typecast\_to}{td\_typecast\_to}}
{\footnotesize\ttfamily \#define td\+\_\+typecast\+\_\+to(\begin{DoxyParamCaption}\item[{}]{td,  }\item[{}]{itype,  }\item[{}]{otype }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{    \textcolor{keywordflow}{do} \{ \(\backslash\)}
\DoxyCodeLine{    itype in\_val = (td)-\/>\mbox{\hyperlink{gsttensor__if_8c_a3c9cc8d6e8da85fef51da4c7115b97f6}{data}}.\_}

\end{DoxyCode}
\mbox{\Hypertarget{tensor__data_8c_aca06d17207971a5f28c2cff576ba7f77}\label{tensor__data_8c_aca06d17207971a5f28c2cff576ba7f77}} 
\index{tensor\_data.c@{tensor\_data.c}!td\_typecast\_to\_fromf16@{td\_typecast\_to\_fromf16}}
\index{td\_typecast\_to\_fromf16@{td\_typecast\_to\_fromf16}!tensor\_data.c@{tensor\_data.c}}
\doxysubsubsection{\texorpdfstring{td\_typecast\_to\_fromf16}{td\_typecast\_to\_fromf16}}
{\footnotesize\ttfamily \#define td\+\_\+typecast\+\_\+to\+\_\+fromf16(\begin{DoxyParamCaption}\item[{}]{td,  }\item[{}]{itype }\end{DoxyParamCaption})}

{\bfseries Value\+:}
\begin{DoxyCode}{0}
\DoxyCodeLine{    \textcolor{keywordflow}{do} \{ \(\backslash\)}
\DoxyCodeLine{    nns\_loge (\textcolor{stringliteral}{"Your nnstreamer binary is built without -\/DFLOAT16\_SUPPORT option; thus float16 is not supported.\(\backslash\)n"}); \(\backslash\)}
\DoxyCodeLine{    g\_assert (0); \(\backslash\)}
\DoxyCodeLine{  \} \textcolor{keywordflow}{while} (0)}

\end{DoxyCode}


\doxysubsection{Function Documentation}
\mbox{\Hypertarget{tensor__data_8c_a4de1a130d54d3afe078e655d58ba1e20}\label{tensor__data_8c_a4de1a130d54d3afe078e655d58ba1e20}} 
\index{tensor\_data.c@{tensor\_data.c}!gst\_tensor\_data\_get@{gst\_tensor\_data\_get}}
\index{gst\_tensor\_data\_get@{gst\_tensor\_data\_get}!tensor\_data.c@{tensor\_data.c}}
\doxysubsubsection{\texorpdfstring{gst\_tensor\_data\_get()}{gst\_tensor\_data\_get()}}
{\footnotesize\ttfamily gboolean gst\+\_\+tensor\+\_\+data\+\_\+get (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{structtensor__data__s}{tensor\+\_\+data\+\_\+s}} $\ast$}]{td,  }\item[{gpointer}]{value }\end{DoxyParamCaption})}



Get tensor element value. 


\begin{DoxyParams}{Parameters}
{\em td} & struct for tensor data \\
\hline
{\em value} & pointer of tensor element value \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
T\+R\+UE if no error 
\end{DoxyReturn}


Definition at line 143 of file tensor\+\_\+data.\+c.

Here is the caller graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{tensor__data_8c_a4de1a130d54d3afe078e655d58ba1e20_icgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{tensor__data_8c_a55e1dc3156e118d586f262e90dfa4483}\label{tensor__data_8c_a55e1dc3156e118d586f262e90dfa4483}} 
\index{tensor\_data.c@{tensor\_data.c}!gst\_tensor\_data\_raw\_average@{gst\_tensor\_data\_raw\_average}}
\index{gst\_tensor\_data\_raw\_average@{gst\_tensor\_data\_raw\_average}!tensor\_data.c@{tensor\_data.c}}
\doxysubsubsection{\texorpdfstring{gst\_tensor\_data\_raw\_average()}{gst\_tensor\_data\_raw\_average()}}
{\footnotesize\ttfamily gboolean gst\+\_\+tensor\+\_\+data\+\_\+raw\+\_\+average (\begin{DoxyParamCaption}\item[{gpointer}]{raw,  }\item[{gsize}]{length,  }\item[{\mbox{\hyperlink{tensor__typedef_8h_ab5f7feb87196d0b9ae37b11fd819f23e}{tensor\+\_\+type}}}]{type,  }\item[{gdouble $\ast$$\ast$}]{result }\end{DoxyParamCaption})}



Calculate average value of the tensor. 


\begin{DoxyParams}{Parameters}
{\em raw} & pointer of raw tensor data \\
\hline
{\em length} & byte size of raw tensor data \\
\hline
{\em type} & tensor type \\
\hline
{\em result} & double pointer for average value of given tensor. Caller should release allocated memory. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
T\+R\+UE if no error 
\end{DoxyReturn}


Definition at line 315 of file tensor\+\_\+data.\+c.

Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{tensor__data_8c_a55e1dc3156e118d586f262e90dfa4483_cgraph}
\end{center}
\end{figure}
Here is the caller graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{tensor__data_8c_a55e1dc3156e118d586f262e90dfa4483_icgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{tensor__data_8c_aae7c3dbd38e2214bb52d4f48c334c992}\label{tensor__data_8c_aae7c3dbd38e2214bb52d4f48c334c992}} 
\index{tensor\_data.c@{tensor\_data.c}!gst\_tensor\_data\_raw\_average\_per\_channel@{gst\_tensor\_data\_raw\_average\_per\_channel}}
\index{gst\_tensor\_data\_raw\_average\_per\_channel@{gst\_tensor\_data\_raw\_average\_per\_channel}!tensor\_data.c@{tensor\_data.c}}
\doxysubsubsection{\texorpdfstring{gst\_tensor\_data\_raw\_average\_per\_channel()}{gst\_tensor\_data\_raw\_average\_per\_channel()}}
{\footnotesize\ttfamily gboolean gst\+\_\+tensor\+\_\+data\+\_\+raw\+\_\+average\+\_\+per\+\_\+channel (\begin{DoxyParamCaption}\item[{gpointer}]{raw,  }\item[{gsize}]{length,  }\item[{\mbox{\hyperlink{tensor__typedef_8h_ab5f7feb87196d0b9ae37b11fd819f23e}{tensor\+\_\+type}}}]{type,  }\item[{\mbox{\hyperlink{tensor__typedef_8h_ae58ce2b6d47c4a2e9c5f3f621c6a5b9a}{tensor\+\_\+dim}}}]{dim,  }\item[{gdouble $\ast$$\ast$}]{results }\end{DoxyParamCaption})}



Calculate average value of the tensor per channel (the first dim). 


\begin{DoxyParams}{Parameters}
{\em raw} & pointer of raw tensor data \\
\hline
{\em length} & byte size of raw tensor data \\
\hline
{\em type} & tensor type \\
\hline
{\em tensor\+\_\+dim} & tensor dimension \\
\hline
{\em results} & double array contains average values of each channel. Caller should release allocated array. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
T\+R\+UE if no error 
\end{DoxyReturn}


Definition at line 360 of file tensor\+\_\+data.\+c.

Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{tensor__data_8c_aae7c3dbd38e2214bb52d4f48c334c992_cgraph}
\end{center}
\end{figure}
Here is the caller graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{tensor__data_8c_aae7c3dbd38e2214bb52d4f48c334c992_icgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{tensor__data_8c_a95a28ea109ce9757a7a9b69196a820f7}\label{tensor__data_8c_a95a28ea109ce9757a7a9b69196a820f7}} 
\index{tensor\_data.c@{tensor\_data.c}!gst\_tensor\_data\_raw\_std@{gst\_tensor\_data\_raw\_std}}
\index{gst\_tensor\_data\_raw\_std@{gst\_tensor\_data\_raw\_std}!tensor\_data.c@{tensor\_data.c}}
\doxysubsubsection{\texorpdfstring{gst\_tensor\_data\_raw\_std()}{gst\_tensor\_data\_raw\_std()}}
{\footnotesize\ttfamily gboolean gst\+\_\+tensor\+\_\+data\+\_\+raw\+\_\+std (\begin{DoxyParamCaption}\item[{gpointer}]{raw,  }\item[{gsize}]{length,  }\item[{\mbox{\hyperlink{tensor__typedef_8h_ab5f7feb87196d0b9ae37b11fd819f23e}{tensor\+\_\+type}}}]{type,  }\item[{gdouble $\ast$}]{average,  }\item[{gdouble $\ast$$\ast$}]{result }\end{DoxyParamCaption})}



Calculate standard deviation of the tensor. 


\begin{DoxyParams}{Parameters}
{\em raw} & pointer of raw tensor data \\
\hline
{\em length} & byte size of raw tensor data \\
\hline
{\em type} & tensor type \\
\hline
{\em average} & average value of given tensor \\
\hline
{\em result} & double pointer for standard deviation of given tensor. Caller should release allocated memory. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
T\+R\+UE if no error 
\end{DoxyReturn}


Definition at line 409 of file tensor\+\_\+data.\+c.

Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{tensor__data_8c_a95a28ea109ce9757a7a9b69196a820f7_cgraph}
\end{center}
\end{figure}
Here is the caller graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{tensor__data_8c_a95a28ea109ce9757a7a9b69196a820f7_icgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{tensor__data_8c_ae5da97dddbdf99c3056086431f486710}\label{tensor__data_8c_ae5da97dddbdf99c3056086431f486710}} 
\index{tensor\_data.c@{tensor\_data.c}!gst\_tensor\_data\_raw\_std\_per\_channel@{gst\_tensor\_data\_raw\_std\_per\_channel}}
\index{gst\_tensor\_data\_raw\_std\_per\_channel@{gst\_tensor\_data\_raw\_std\_per\_channel}!tensor\_data.c@{tensor\_data.c}}
\doxysubsubsection{\texorpdfstring{gst\_tensor\_data\_raw\_std\_per\_channel()}{gst\_tensor\_data\_raw\_std\_per\_channel()}}
{\footnotesize\ttfamily gboolean gst\+\_\+tensor\+\_\+data\+\_\+raw\+\_\+std\+\_\+per\+\_\+channel (\begin{DoxyParamCaption}\item[{gpointer}]{raw,  }\item[{gsize}]{length,  }\item[{\mbox{\hyperlink{tensor__typedef_8h_ab5f7feb87196d0b9ae37b11fd819f23e}{tensor\+\_\+type}}}]{type,  }\item[{\mbox{\hyperlink{tensor__typedef_8h_ae58ce2b6d47c4a2e9c5f3f621c6a5b9a}{tensor\+\_\+dim}}}]{dim,  }\item[{gdouble $\ast$}]{averages,  }\item[{gdouble $\ast$$\ast$}]{results }\end{DoxyParamCaption})}



Calculate standard deviation of the tensor per channel (the first dim). 


\begin{DoxyParams}{Parameters}
{\em raw} & pointer of raw tensor data \\
\hline
{\em length} & byte size of raw tensor data \\
\hline
{\em type} & tensor type \\
\hline
{\em tensor\+\_\+dim} & tensor dimension \\
\hline
{\em averages} & average values of given tensor per-\/channel \\
\hline
{\em results} & double array contains standard deviation of each channel. Caller should release allocated array. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
T\+R\+UE if no error 
\end{DoxyReturn}


Definition at line 455 of file tensor\+\_\+data.\+c.

Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{tensor__data_8c_ae5da97dddbdf99c3056086431f486710_cgraph}
\end{center}
\end{figure}
Here is the caller graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{tensor__data_8c_ae5da97dddbdf99c3056086431f486710_icgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{tensor__data_8c_a19e19448fcbdd10d056c03d29a14dd38}\label{tensor__data_8c_a19e19448fcbdd10d056c03d29a14dd38}} 
\index{tensor\_data.c@{tensor\_data.c}!gst\_tensor\_data\_raw\_typecast@{gst\_tensor\_data\_raw\_typecast}}
\index{gst\_tensor\_data\_raw\_typecast@{gst\_tensor\_data\_raw\_typecast}!tensor\_data.c@{tensor\_data.c}}
\doxysubsubsection{\texorpdfstring{gst\_tensor\_data\_raw\_typecast()}{gst\_tensor\_data\_raw\_typecast()}}
{\footnotesize\ttfamily gboolean gst\+\_\+tensor\+\_\+data\+\_\+raw\+\_\+typecast (\begin{DoxyParamCaption}\item[{gpointer}]{input,  }\item[{\mbox{\hyperlink{tensor__typedef_8h_ab5f7feb87196d0b9ae37b11fd819f23e}{tensor\+\_\+type}}}]{in\+\_\+type,  }\item[{gpointer}]{output,  }\item[{\mbox{\hyperlink{tensor__typedef_8h_ab5f7feb87196d0b9ae37b11fd819f23e}{tensor\+\_\+type}}}]{out\+\_\+type }\end{DoxyParamCaption})}



Typecast tensor element value. 


\begin{DoxyParams}{Parameters}
{\em input} & pointer of input tensor data \\
\hline
{\em in\+\_\+type} & input tensor type \\
\hline
{\em output} & pointer of output tensor data \\
\hline
{\em out\+\_\+type} & output tensor type \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
T\+R\+UE if no error 
\end{DoxyReturn}


Definition at line 290 of file tensor\+\_\+data.\+c.

Here is the call graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{tensor__data_8c_a19e19448fcbdd10d056c03d29a14dd38_cgraph}
\end{center}
\end{figure}
Here is the caller graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{tensor__data_8c_a19e19448fcbdd10d056c03d29a14dd38_icgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{tensor__data_8c_a46a370094cb45ebbbf8b591e908abf7d}\label{tensor__data_8c_a46a370094cb45ebbbf8b591e908abf7d}} 
\index{tensor\_data.c@{tensor\_data.c}!gst\_tensor\_data\_typecast@{gst\_tensor\_data\_typecast}}
\index{gst\_tensor\_data\_typecast@{gst\_tensor\_data\_typecast}!tensor\_data.c@{tensor\_data.c}}
\doxysubsubsection{\texorpdfstring{gst\_tensor\_data\_typecast()}{gst\_tensor\_data\_typecast()}}
{\footnotesize\ttfamily gboolean gst\+\_\+tensor\+\_\+data\+\_\+typecast (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{structtensor__data__s}{tensor\+\_\+data\+\_\+s}} $\ast$}]{td,  }\item[{\mbox{\hyperlink{tensor__typedef_8h_ab5f7feb87196d0b9ae37b11fd819f23e}{tensor\+\_\+type}}}]{type }\end{DoxyParamCaption})}



Typecast tensor element data. 


\begin{DoxyParams}{Parameters}
{\em td} & struct for tensor data \\
\hline
{\em type} & tensor type to be transformed \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
T\+R\+UE if no error 
\end{DoxyReturn}


Definition at line 203 of file tensor\+\_\+data.\+c.

Here is the caller graph for this function\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{tensor__data_8c_a46a370094cb45ebbbf8b591e908abf7d_icgraph}
\end{center}
\end{figure}
\mbox{\Hypertarget{tensor__data_8c_a8ca9996595b367352d5665c3ee092ffa}\label{tensor__data_8c_a8ca9996595b367352d5665c3ee092ffa}} 
\index{tensor\_data.c@{tensor\_data.c}!while@{while}}
\index{while@{while}!tensor\_data.c@{tensor\_data.c}}
\doxysubsubsection{\texorpdfstring{while()}{while()}}
{\footnotesize\ttfamily while (\begin{DoxyParamCaption}\item[{0}]{ }\end{DoxyParamCaption})}



dtype = $\ast$((dtype $\ast$) v); \textbackslash{} 



Definition at line 23 of file tensor\+\_\+data.\+c.

