[runtime/api] Update nnfw_tensorinfo (#9224)
author오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Wed, 27 Nov 2019 01:05:37 +0000 (10:05 +0900)
committer이춘석/On-Device Lab(SR)/Staff Engineer/삼성전자 <chunseok.lee@samsung.com>
Wed, 27 Nov 2019 01:05:37 +0000 (10:05 +0900)
Merge typedef and struct definition
Add comment for nnfw_tensorinfo

Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>
runtime/neurun/api/include/nnfw.h

index f1b8a45..9c80d02 100644 (file)
@@ -55,8 +55,6 @@ extern "C" {
  */
 typedef struct nnfw_session nnfw_session;
 
-typedef struct nnfw_tensorinfo nnfw_tensorinfo;
-
 typedef enum {
   NNFW_TYPE_TENSOR_FLOAT32 = 0,
   NNFW_TYPE_TENSOR_INT32 = 1,
@@ -87,14 +85,22 @@ typedef enum {
 } NNFW_LAYOUT;
 
 /**
- * tensor_info
+ * tensor_info describes the type and shape of tensors
+ *
+ * <p>This structure is used to describe input and output tensors.
+ * Application can get input and output tensor type and shape described in model by using
+ * {@link nnfw_input_tensorinfo} and {@link nnfw_output_tensorinfo}
+ *
+ * <p>Maximum rank is 6. And tensor's dimension value is filled in 'dims' field from index 0.
+ * For example, if tensor's rank is 4,
+ * application can get dimension value from dims[0], dims[1], dims[2], and dims[3]
  */
-struct nnfw_tensorinfo
+typedef struct nnfw_tensorinfo
 {
   NNFW_TYPE dtype;
   int rank;
-  int dims[6]; // MAX rank is 6
-};
+  int dims[6];
+} nnfw_tensorinfo;
 
 /*
  * Create a new session instance