Doxygen Book
tensor_data.h File Reference

Internal functions to handle various tensor type and value. More...

#include <glib.h>
#include <tensor_typedef.h>
Include dependency graph for tensor_data.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  tensor_data_s
 Structure for tensor data. More...
 

Functions

gboolean gst_tensor_data_set (tensor_data_s *td, tensor_type type, gpointer value)
 Set tensor element data with given type. More...
 
gboolean gst_tensor_data_get (tensor_data_s *td, gpointer value)
 Get tensor element value. More...
 
gboolean gst_tensor_data_typecast (tensor_data_s *td, tensor_type type)
 Typecast tensor element data. More...
 
gboolean gst_tensor_data_raw_typecast (gpointer input, tensor_type in_type, gpointer output, tensor_type out_type)
 Typecast tensor element value. More...
 
gboolean gst_tensor_data_raw_average (gpointer raw, gsize length, tensor_type type, gdouble **result)
 Calculate average value of the tensor. More...
 
gboolean gst_tensor_data_raw_average_per_channel (gpointer raw, gsize length, tensor_type type, tensor_dim dim, gdouble **results)
 Calculate average value of the tensor per channel (the first dim). More...
 
gboolean gst_tensor_data_raw_std (gpointer raw, gsize length, tensor_type type, gdouble *average, gdouble **result)
 Calculate standard deviation of the tensor. More...
 
gboolean gst_tensor_data_raw_std_per_channel (gpointer raw, gsize length, tensor_type type, tensor_dim dim, gdouble *averages, gdouble **results)
 Calculate standard deviation of the tensor per channel (the first dim). More...
 

Detailed Description

Internal functions to handle various tensor type and value.

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

Date
10 Mar 2021
See also
http://github.com/nnstreamer/nnstreamer
Author
Jaeyun Jung jy121.nosp@m.0.ju.nosp@m.ng@sa.nosp@m.msun.nosp@m.g.com
Bug:
No known bugs except for NYI items

Definition in file tensor_data.h.

Function Documentation

◆ gst_tensor_data_get()

gboolean gst_tensor_data_get ( tensor_data_s td,
gpointer  value 
)

Get tensor element value.

Parameters
tdstruct for tensor data
valuepointer of tensor element value
Returns
TRUE if no error

Definition at line 143 of file tensor_data.c.

Here is the caller graph for this function:

◆ gst_tensor_data_raw_average()

gboolean gst_tensor_data_raw_average ( gpointer  raw,
gsize  length,
tensor_type  type,
gdouble **  result 
)

Calculate average value of the tensor.

Parameters
rawpointer of raw tensor data
lengthbyte size of raw tensor data
typetensor type
resultdouble pointer for average value of given tensor. Caller should release allocated memory.
Returns
TRUE if no error

Definition at line 315 of file tensor_data.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensor_data_raw_average_per_channel()

gboolean gst_tensor_data_raw_average_per_channel ( gpointer  raw,
gsize  length,
tensor_type  type,
tensor_dim  dim,
gdouble **  results 
)

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

Parameters
rawpointer of raw tensor data
lengthbyte size of raw tensor data
typetensor type
tensor_dimtensor dimension
resultsdouble array contains average values of each channel. Caller should release allocated array.
Returns
TRUE if no error

Definition at line 360 of file tensor_data.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensor_data_raw_std()

gboolean gst_tensor_data_raw_std ( gpointer  raw,
gsize  length,
tensor_type  type,
gdouble *  average,
gdouble **  result 
)

Calculate standard deviation of the tensor.

Parameters
rawpointer of raw tensor data
lengthbyte size of raw tensor data
typetensor type
averageaverage value of given tensor
resultdouble pointer for standard deviation of given tensor. Caller should release allocated memory.
Returns
TRUE if no error

Definition at line 409 of file tensor_data.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensor_data_raw_std_per_channel()

gboolean gst_tensor_data_raw_std_per_channel ( gpointer  raw,
gsize  length,
tensor_type  type,
tensor_dim  dim,
gdouble *  averages,
gdouble **  results 
)

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

Parameters
rawpointer of raw tensor data
lengthbyte size of raw tensor data
typetensor type
tensor_dimtensor dimension
averagesaverage values of given tensor per-channel
resultsdouble array contains standard deviation of each channel. Caller should release allocated array.
Returns
TRUE if no error

Definition at line 455 of file tensor_data.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensor_data_raw_typecast()

gboolean gst_tensor_data_raw_typecast ( gpointer  input,
tensor_type  in_type,
gpointer  output,
tensor_type  out_type 
)

Typecast tensor element value.

Parameters
inputpointer of input tensor data
in_typeinput tensor type
outputpointer of output tensor data
out_typeoutput tensor type
Returns
TRUE if no error

Definition at line 290 of file tensor_data.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gst_tensor_data_set()

gboolean gst_tensor_data_set ( tensor_data_s td,
tensor_type  type,
gpointer  value 
)

Set tensor element data with given type.

Parameters
tdstruct for tensor data
typetensor type
valuepointer of tensor element value
Returns
TRUE if no error
Here is the caller graph for this function:

◆ gst_tensor_data_typecast()

gboolean gst_tensor_data_typecast ( tensor_data_s td,
tensor_type  type 
)

Typecast tensor element data.

Parameters
tdstruct for tensor data
typetensor type to be transformed
Returns
TRUE if no error

Definition at line 203 of file tensor_data.c.

Here is the caller graph for this function: