Doxygen Book
gsttensor_sparseutil.h File Reference

Util functions for tensor_sparse encoder and decoder. More...

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

Go to the source code of this file.

Functions

G_BEGIN_DECLS GstMemory * gst_tensor_sparse_to_dense (GstTensorMetaInfo *meta, GstMemory *mem)
 Make dense tensor with input sparse tensor. More...
 
GstMemory * gst_tensor_sparse_from_dense (GstTensorMetaInfo *meta, GstMemory *mem)
 Make sparse tensor with input dense tensor. More...
 

Detailed Description

Util functions for tensor_sparse encoder and decoder.

GStreamer / NNStreamer Sparse Tensor support Copyright (C) 2021 Yongjoo Ahn yongj.nosp@m.oo1..nosp@m.ahn@s.nosp@m.amsu.nosp@m.ng.co.nosp@m.m

Date
06 Jul 2021
See also
https://github.com/nnstreamer/nnstreamer
Author
Yongjoo Ahn yongj.nosp@m.oo1..nosp@m.ahn@s.nosp@m.amsu.nosp@m.ng.co.nosp@m.m
Bug:
No known bugs except for NYI items

Definition in file gsttensor_sparseutil.h.

Function Documentation

◆ gst_tensor_sparse_from_dense()

GstMemory* gst_tensor_sparse_from_dense ( GstTensorMetaInfo meta,
GstMemory *  mem 
)

Make sparse tensor with input dense tensor.

Parameters
[in,out]metatensor meta structure to be updated
[in]memgst-memory of dense tensor data
Returns
pointer of GstMemory with sparse tensor data or NULL on error. Caller should handle this newly allocated memory.

alloc maximum possible size of memory

Consider using macro to reduce loc and readability

update meta nnz info

write to output buffer

add meta info header

Definition at line 116 of file gsttensor_sparseutil.c.

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

◆ gst_tensor_sparse_to_dense()

G_BEGIN_DECLS GstMemory* gst_tensor_sparse_to_dense ( GstTensorMetaInfo meta,
GstMemory *  mem 
)

Make dense tensor with input sparse tensor.

Parameters
[in,out]metatensor meta structure to be updated
[in]memgst-memory of sparse tensor data
Returns
pointer of GstMemory with dense tensor data or NULL on error. Caller should handle this newly allocated memory.

Definition at line 27 of file gsttensor_sparseutil.c.

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