[CAPI] Add enum for ini saving
authorJihoon Lee <jhoon.it.lee@samsung.com>
Mon, 23 Aug 2021 08:31:45 +0000 (17:31 +0900)
committerJijoong Moon <jijoong.moon@samsung.com>
Thu, 26 Aug 2021 07:50:14 +0000 (16:50 +0900)
This patch adds enum for ini save and load.

**Self evaluation:**
1. Build test: [X]Passed [ ]Failed [ ]Skipped
2. Run test: [X]Passed [ ]Failed [ ]Skipped

Signed-off-by: Jihoon Lee <jhoon.it.lee@samsung.com>
api/capi/include/nntrainer.h
api/ccapi/include/model.h
api/nntrainer-api-common.h

index f9a7b91037408217f06d348f40d15452cc72ea6c..b3c3522fb381afa3f3d19aa3f7d6689c0d972c8d 100644 (file)
@@ -581,8 +581,11 @@ int ml_train_model_save(ml_train_model_h model, const char *file_path,
  * describes various formats in which various selections of the
  * parameters of the models can be loaded. Some formats may load
  * parameters required for training. Some other formats may load model
- * configurations. Unless stated otherwise, ml_train_model_compile() has to
- * be called upon the @a model before calling this function.
+ * configurations. Unless stated otherwise, loading model configuration requires
+ * a freshly constructed model with ml_train_model_construct() without
+ * ml_train_model_compile(), loading model parameter requires
+ * ml_train_model_compile() to be called upon the @a model before calling this
+ * function.
  * @since_tizen 6.5
  * @remarks If you want to access only internal storage by using this function,
  * you should add privilege %http://tizen.org/privilege/mediastorage. Or, if you
index 63f5e7c5922af623a4721268858512c8eadaf513..b6d767edd341fac4c2bf8943d8446487a96156c5 100644 (file)
@@ -48,13 +48,12 @@ enum class ModelType {
  */
 enum class ModelFormat {
   MODEL_FORMAT_BIN =
-    ML_TRAIN_MODEL_FORMAT_BIN, /**< raw bin file saves parameters required
+    ML_TRAIN_MODEL_FORMAT_BIN, /**< raw bin file saves model weights required
 for inference and training without any configurations*/
-
-  /** Comment intended */
-  // MODEL_FORMAT_INI = 1, /**< ini file with save_path defined */
-  // MODEL_FORMAT_INI_WITH_BIN = 2, /**< ini file with save_path
-  // defined */
+  MODEL_FORMAT_INI = ML_TRAIN_MODEL_FORMAT_INI, /**< ini file */
+  MODEL_FORMAT_INI_WITH_BIN =
+    ML_TRAIN_MODEL_FORMAT_INI_WITH_BIN, /**< ini file with save_path defined
+                                           where the binaray will be saved */
 };
 
 /**
index d4f8a391fa33eeb263f326407ba665f41b8c1a72..c69868406cdd10dab450b7cea2fc2d4d0ed86d98 100644 (file)
@@ -215,8 +215,13 @@ typedef enum {
  */
 typedef enum {
   ML_TRAIN_MODEL_FORMAT_BIN =
-    0, /**< raw bin file saves parameters required for inference and training
+    0, /**< Raw bin file saves model weights required for inference and training
           without any configurations*/
+  ML_TRAIN_MODEL_FORMAT_INI =
+    1, /**< Ini format file saves model configurations. */
+  ML_TRAIN_MODEL_FORMAT_INI_WITH_BIN =
+    2 /**< Ini with bin format file saves configurations with parameters
+         required for inference and training. */
 } ml_train_model_format_e;
 
 /**