Doxygen Book
tensor_data.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: LGPL-2.1-only */
13 #ifndef __NNS_TENSOR_DATA_H__
14 #define __NNS_TENSOR_DATA_H__
15 
16 #include <glib.h>
17 #include <tensor_typedef.h>
18 
19 G_BEGIN_DECLS
23 typedef struct
24 {
28 
36 extern gboolean
37 gst_tensor_data_set (tensor_data_s * td, tensor_type type, gpointer value);
38 
45 extern gboolean
46 gst_tensor_data_get (tensor_data_s * td, gpointer value);
47 
54 extern gboolean
56 
65 extern gboolean
66 gst_tensor_data_raw_typecast (gpointer input, tensor_type in_type,
67  gpointer output, tensor_type out_type);
68 
77 extern gboolean
78 gst_tensor_data_raw_average (gpointer raw, gsize length, tensor_type type,
79  gdouble ** result);
80 
90 extern gboolean
91 gst_tensor_data_raw_average_per_channel (gpointer raw, gsize length,
92  tensor_type type, tensor_dim dim, gdouble ** results);
93 
103 extern gboolean
104 gst_tensor_data_raw_std (gpointer raw, gsize length, tensor_type type,
105  gdouble * average, gdouble ** result);
106 
117 extern gboolean
118 gst_tensor_data_raw_std_per_channel (gpointer raw, gsize length,
119  tensor_type type, tensor_dim dim, gdouble * averages, gdouble ** results);
120 
121 G_END_DECLS
122 #endif /* __NNS_TENSOR_DATA_H__ */
tensor_data_s
Structure for tensor data.
Definition: tensor_data.h:23
tensor_dim
uint32_t tensor_dim[NNS_TENSOR_RANK_LIMIT]
Definition: tensor_typedef.h:247
result
case tensor_data_s gboolean * result
Definition: gsttensor_if.c:839
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).
Definition: tensor_data.c:360
tensor_type
enum _nns_tensor_type tensor_type
Possible data element types of other/tensor.
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.
gst_tensor_data_get
gboolean gst_tensor_data_get(tensor_data_s *td, gpointer value)
Get tensor element value.
Definition: tensor_data.c:143
tensor_data_s::data
tensor_element data
Definition: tensor_data.h:26
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.
Definition: tensor_data.c:290
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.
Definition: tensor_data.c:409
gst_tensor_data_typecast
gboolean gst_tensor_data_typecast(tensor_data_s *td, tensor_type type)
Typecast tensor element data.
Definition: tensor_data.c:203
tensor_typedef.h
Common header file for NNStreamer, the GStreamer plugin for neural networks.
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.
Definition: tensor_data.c:315
tensor_element
To make the code simple with all the types. "C++ Template"-like.
Definition: tensor_typedef.h:231
tensor_data_s::type
tensor_type type
Definition: tensor_data.h:25
type
svtc_1 type
Definition: gsttensor_if.c:843
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).
Definition: tensor_data.c:455