Add size member to inference_engine_tensor_buffer structure
authorInki Dae <inki.dae@samsung.com>
Wed, 4 Mar 2020 04:16:35 +0000 (13:16 +0900)
committerInki Dae <inki.dae@samsung.com>
Tue, 14 Apr 2020 00:42:53 +0000 (09:42 +0900)
With this patch, the size member of inference_engine_tensor_info
structure means a tensor element size which is calculated by
height * width * channel count, and the size member of
inference_engine_tensor_buffer structure means a actual tensor
buffer size in bytes which is calculated by height * width * channel count
* pixel per bytes.

Change-Id: Ic88e34035c45386fa712e7ab922a296a4bad0ac9
Signed-off-by: Inki Dae <inki.dae@samsung.com>
include/inference_engine_type.h

index d14139927bcb56cf47f906f1df0c031d5736de5e..7f391bedd385f88980b487774ca76ca9747bf6b0 100644 (file)
@@ -147,6 +147,7 @@ typedef struct _inference_engine_config {
 typedef struct _inference_engine_tensor_buffer {
     void *buffer; /**< a buffer which contains tensor data. */
     inference_tensor_data_type_e data_type; /**< a tensor type of the layer. */
+    size_t size; /**< actual tensor buffer size in bytes. The size should be height * width * channel count * bytes per pixel. */
     // TODO.
 } inference_engine_tensor_buffer;
 
@@ -157,9 +158,9 @@ typedef struct _inference_engine_tensor_buffer {
  *    - a name of a given layer
  *    - a tensor shape of the layer
  *    - a tensor type of the layer
- *    - a tensor size of the layer.
+ *    - a tensor element size of the layer.
  *
- * Caution. Tensor size is not in-memory buffer size in bytes so based on a given tensor size,
+ * Caution. Tensor element size is not in-memory buffer size in bytes so based on a given tensor element size,
  * upper framework should allocate actual tensor buffer according to tensor data types (i.e., uint8, float32...)
  *
  * @since_tizen 6.0
@@ -168,7 +169,7 @@ typedef struct _inference_engine_tensor_info {
     std::vector<int> shape; /**< a tensor shape. */
     inference_tensor_shape_type_e shape_type; /**< a tensor shape of the layer. */
     inference_tensor_data_type_e data_type; /**< a tensor type of the layer. */
-    size_t size; /** tensor buffer size. The size should be height * width * channel count */
+    size_t size; /** tensor element size. The size should be height * width * channel count */
     // TODO.
 } inference_engine_tensor_info;