Util functions for tensor_sparse encoder and decoder. More...
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... | |
Util functions for tensor_sparse encoder and decoder.
GStreamer / NNStreamer Sparse Tensor support Copyright (C) 2021 Yongjoo Ahn yongj oo1. ahn@s amsu ng.co m
Definition in file gsttensor_sparseutil.h.
GstMemory* gst_tensor_sparse_from_dense | ( | GstTensorMetaInfo * | meta, |
GstMemory * | mem | ||
) |
Make sparse tensor with input dense tensor.
[in,out] | meta | tensor meta structure to be updated |
[in] | mem | gst-memory of dense tensor data |
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.
G_BEGIN_DECLS GstMemory* gst_tensor_sparse_to_dense | ( | GstTensorMetaInfo * | meta, |
GstMemory * | mem | ||
) |
Make dense tensor with input sparse tensor.
[in,out] | meta | tensor meta structure to be updated |
[in] | mem | gst-memory of sparse tensor data |
Definition at line 27 of file gsttensor_sparseutil.c.