[capi] Comply with Tizen ACR comments
authorParichay Kapoor <pk.kapoor@samsung.com>
Tue, 18 Aug 2020 05:43:34 +0000 (14:43 +0900)
committerJijoong Moon <jijoong.moon@samsung.com>
Tue, 18 Aug 2020 07:16:08 +0000 (16:16 +0900)
This patch applies comments from the Tizen ACR
- Comments to have % as prefic
- remove ML_ERROR_CANNOT_ASSIGN_ADDRESS as it unknown and not used
- Remove `experiment API` statements
- 6.x -> 6.0
- Add groups in api-common.h

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

Signed-off-by: Parichay Kapoor <pk.kapoor@samsung.com>
api/capi/doc/nntrainer_doc.h
api/capi/include/nntrainer.h
api/capi/include/nntrainer_internal.h
api/capi/src/nntrainer.cpp
api/nntrainer-api-common.h
nntrainer/include/nntrainer_error.h

index 9fa783b..f4eea6a 100644 (file)
@@ -51,7 +51,7 @@
  * features, please define the features in your manifest file using the manifest
  * editor in the SDK.\n
  * For example, your application accesses to the camera device,
- * then you have to add 'http://tizen.org/privilege/camera' into the manifest of
+ * then you have to add %http://tizen.org/privilege/camera into the manifest of
  * your application.\n More details on featuring your application can be found
  * from <a
  * href="https://docs.tizen.org/application/tizen-studio/native-tools/manifest-text-editor#feature-element">
index 21df7d4..0e65374 100644 (file)
@@ -21,8 +21,6 @@
  * @author Jijoong Moon <jijoong.moon@samsung.com>
  * @author Parichay Kapoor <pk.kapoor@samsung.com>
  * @bug No known bugs except for NYI items
- *
- * @note This API is not stable and still experimental.
  */
 
 #ifndef __TIZEN_MACHINELEARNING_NNTRAINER_H__
@@ -92,16 +90,15 @@ typedef enum {
  * @since_tizen 6.0
  * @remarks If the function succeeds, @a model must be released using
  * ml_train_model_destroy().
- * @remarks http://tizen.org/privilege/mediastorage is needed if @a model is
+ * @remarks %http://tizen.org/privilege/mediastorage is needed if @a model is
  * saved to media storage.
- * @remarks http://tizen.org/privilege/externalstorage is needed if @a model is
+ * @remarks %http://tizen.org/privilege/externalstorage is needed if @a model is
  * saved to external storage.
  * @param[out] model The NNTrainer model handle from the given description.
  * @return @c 0 on success. Otherwise a negative error value.
  * @retval #ML_ERROR_NONE Successful.
  * @retval #ML_ERROR_NOT_SUPPORTED Not supported.
  * @retval #ML_ERROR_INVALID_PARAMETER Invalid parameter.
- * @retval #ML_ERROR_CANNOT_ASSIGN_ADDRESS Cannot assign object.
  */
 int ml_train_model_construct(ml_train_model_h *model);
 
@@ -112,7 +109,6 @@ int ml_train_model_construct(ml_train_model_h *model);
  * @since_tizen 6.0
  * @remarks If the function succeeds, @a model must be released using
  * ml_train_model_destroy().
- * @note This is experimental and not stable.
  * @param[in] model_conf The nntrainer model configuration file.
  * @param[out] model The NNTrainer model handle from the given description.
  * @return @c 0 on success. Otherwise a negative error value.
@@ -131,7 +127,6 @@ int ml_train_model_construct_with_conf(const char *model_conf,
  * the model will be restricted. Further, addition of layers or changing the
  * optimizer/dataset of the model will not be permitted.
  * @since_tizen 6.0
- * @note This is experimental and not stable.
  * @param[in] model The NNTrainer model handle.
  * @param[in] ... hyperparmeters for compiling the model
  * @return @c 0 on success. Otherwise a negative error value.
@@ -147,7 +142,6 @@ int ml_train_model_compile(ml_train_model_h model, ...);
  * the passed training hyperparameters. This function will return once the
  * training, along with requested validation and testing, is completed.
  * @since_tizen 6.0
- * @note This is experimental and not stable.
  * @param[in] model The NNTrainer model handle.
  * @param[in] ...  Hyperparmeters for train model.
  * @return @c 0 on success. Otherwise a negative error value.
@@ -175,7 +169,6 @@ int ml_train_model_destroy(ml_train_model_h model);
  * @since_tizen 6.0
  * @remarks If the function succeeds, @a summary should be released using
  * free().
- * @note This is experimental and not stable.
  * @param[in] model The NNTrainer model handle to get summary.
  * @param[in] verbosity Verbose level of the summary
  * @param[out] summary The summary of the current model. Avoid logic to parse
@@ -196,7 +189,6 @@ int ml_train_model_get_summary(ml_train_model_h model,
  * ownership of the layer to the network. No need to destroy the layer once it
  * is added to a model.
  * @since_tizen 6.0
- * @note This is experimental and not stable.
  * @param[in] model The NNTrainer model handle.
  * @param[in] layer The NNTrainer layer handle.
  * @return @c 0 on success. Otherwise a negative error value.
@@ -214,7 +206,6 @@ int ml_train_model_add_layer(ml_train_model_h model, ml_train_layer_h layer);
  * @since_tizen 6.0
  * @remarks Unsets the previously set optimizer, if any. The previously set
  * optimizer must be freed using ml_train_optimizer_destroy().
- * @note This is experimental and not stable.
  * @param[in] model The NNTrainer model handle.
  * @param[in] optimizer The NNTrainer optimizer handle.
  * @return @c 0 on success. Otherwise a negative error value.
@@ -234,7 +225,6 @@ int ml_train_model_set_optimizer(ml_train_model_h model,
  * @since_tizen 6.0
  * @remarks Unsets the previously set dataset, if any. The previously set
  * dataset must be freed using ml_train_dataset_destroy().
- * @note This is experimental and not stable.
  * @param[in] model The NNTrainer model handle.
  * @param[in] dataset The NNTrainer dataset handle.
  * @return @c 0 on success. Otherwise a negative error value.
@@ -252,14 +242,12 @@ int ml_train_model_set_dataset(ml_train_model_h model,
  * @remarks If the function succeeds, @a layer must be released using
  * ml_train_layer_destroy(), if not added to a model. If added to a model, @a
  * layer is available until the model is released.
- * @note This is experimental and not stable.
  * @param[out] layer The NNTrainer layer handle from the given description.
  * @param[in]  type The NNTrainer layer type
  * @return @c 0 on success. Otherwise a negative error value.
  * @retval #ML_ERROR_NONE Successful.
  * @retval #ML_ERROR_NOT_SUPPORTED Not supported.
  * @retval #ML_ERROR_INVALID_PARAMETER Invalid parameter.
- * @retval #ML_ERROR_CANNOT_ASSIGN_ADDRESS Cannot assign object.
  */
 int ml_train_layer_create(ml_train_layer_h *layer, ml_train_layer_type_e type);
 
@@ -268,7 +256,6 @@ int ml_train_layer_create(ml_train_layer_h *layer, ml_train_layer_type_e type);
  * @details Use this function to destroy neural network layer. Fails if layer is
  * owned by a model.
  * @since_tizen 6.0
- * @note This is experimental and not stable.
  * @param[in] layer The NNTrainer layer handle.
  * @return @c 0 on success. Otherwise a negative error value.
  * @retval #ML_ERROR_NONE Successful.
@@ -281,7 +268,6 @@ int ml_train_layer_destroy(ml_train_layer_h layer);
  * @brief Sets the neural network layer Property.
  * @details Use this function to set neural network layer Property.
  * @since_tizen 6.0
- * @note This is experimental and not stable.
  * @param[in] layer The NNTrainer layer handle.
  * @param[in]  ... Property values with NULL for termination.
  * @return @c 0 on success. Otherwise a negative error value.
@@ -328,14 +314,12 @@ int ml_train_layer_set_property(ml_train_layer_h layer, ...);
  * @remarks If the function succeeds, @a optimizer must be released using
  * ml_train_optimizer_destroy(), if not set to a model. If set to a model, @a
  * optimizer is available until the model is released.
- * @note This is experimental and not stable.
  * @param[out] optimizer The NNTrainer optimizer handle.
  * @param[in] type The NNTrainer optimizer type.
  * @return @c 0 on success. Otherwise a negative error value.
  * @retval #ML_ERROR_NONE Successful.
  * @retval #ML_ERROR_NOT_SUPPORTED Not supported.
  * @retval #ML_ERROR_INVALID_PARAMETER Invalid parameter.
- * @retval #ML_ERROR_CANNOT_ASSIGN_ADDRESS Cannot assign object.
  */
 int ml_train_optimizer_create(ml_train_optimizer_h *optimizer,
                               ml_train_optimizer_type_e type);
@@ -345,7 +329,6 @@ int ml_train_optimizer_create(ml_train_optimizer_h *optimizer,
  * @details Use this function to destroy neural network optimizer. Fails if
  * optimizer is owned by a model.
  * @since_tizen 6.0
- * @note This is experimental and not stable.
  * @param[in] optimizer The NNTrainer optimizer handle.
  * @return @c 0 on success. Otherwise a negative error value.
  * @retval #ML_ERROR_NONE Successful.
@@ -358,7 +341,6 @@ int ml_train_optimizer_destroy(ml_train_optimizer_h optimizer);
  * @brief Sets the neural network optimizer property.
  * @details Use this function to set neural network optimizer property.
  * @since_tizen 6.0
- * @note This is experimental and not stable.
  * @param[in] optimizer The NNTrainer optimizer handle.
  * @param[in]  ... Property values with NULL for termination.
  * @return @c 0 on success. Otherwise a negative error value.
@@ -378,7 +360,6 @@ int ml_train_optimizer_set_property(ml_train_optimizer_h optimizer, ...);
  * @remarks If the function succeeds, @a dataset must be released using
  * ml_train_dataset_destroy(), if not set to a model. If set to a model, @a
  * dataset is available until the model is released.
- * @note This is experimental and not stable.
  *
  * @param[out] dataset The NNTrainer dataset handle from the given description.
  * If not set to a model, @a dataset should be released using
@@ -391,7 +372,6 @@ int ml_train_optimizer_set_property(ml_train_optimizer_h optimizer, ...);
  * @retval #ML_ERROR_NONE Successful.
  * @retval #ML_ERROR_NOT_SUPPORTED Not supported.
  * @retval #ML_ERROR_INVALID_PARAMETER Invalid parameter.
- * @retval #ML_ERROR_CANNOT_ASSIGN_ADDRESS Cannot assign object.
  */
 int ml_train_dataset_create_with_generator(ml_train_dataset_h *dataset,
                                            ml_train_datagen_cb train_cb,
@@ -403,7 +383,6 @@ int ml_train_dataset_create_with_generator(ml_train_dataset_h *dataset,
  * @details Use this function to create a neural network dataset using
  * files.
  * @since_tizen 6.0
- * @note This is experimental and not stable.
  * @param[out] dataset The NNTrainer dataset handle from the given description.
  * If not set to a model, @a dataset should be released using
  * ml_train_dataset_destroy(). If set to a model, @a dataset is available until
@@ -415,7 +394,6 @@ int ml_train_dataset_create_with_generator(ml_train_dataset_h *dataset,
  * @retval #ML_ERROR_NONE Successful.
  * @retval #ML_ERROR_NOT_SUPPORTED Not supported.
  * @retval #ML_ERROR_INVALID_PARAMETER Invalid parameter.
- * @retval #ML_ERROR_CANNOT_ASSIGN_ADDRESS Cannot assign object.
  */
 int ml_train_dataset_create_with_file(ml_train_dataset_h *dataset,
                                       const char *train_file,
@@ -427,7 +405,6 @@ int ml_train_dataset_create_with_file(ml_train_dataset_h *dataset,
  * @details Use this function to destroy dataset. Fails if dataset is owned by a
  * model.
  * @since_tizen 6.0
- * @note This is experimental and not stable.
  * @param[in] dataset The NNTrainer dataset handle.
  * @return @c 0 on success. Otherwise a negative error value.
  * @retval #ML_ERROR_NONE Successful.
@@ -440,7 +417,6 @@ int ml_train_dataset_destroy(ml_train_dataset_h dataset);
  * @brief Sets the neural network dataset property.
  * @details Use this function to set dataset property.
  * @since_tizen 6.0
- * @note This is experimental and not stable.
  * @param[in] dataset The NNTrainer dataset handle.
  * @param[in]  ... Property values with NULL for termination.
  * @return @c 0 on success. Otherwise a negative error value.
index 62dc9b5..b0e3d1c 100644 (file)
@@ -20,8 +20,6 @@
  * @author Jijoong Moon <jijoong.moon@samsung.com>
  * @author Parichay Kapoor <pk.kapoor@samsung.com>
  * @bug No known bugs except for NYI items
- *
- * @note This API is not stable and still experimental.
  */
 
 #ifndef __NNTRAINER_INTERNAL_H__
@@ -242,7 +240,6 @@ typedef struct {
  * @return @c 0 on success. Otherwise a negative error value.
  * @retval #ML_ERROR_NONE Successful.
  * @retval #ML_ERROR_INVALID_PARAMETER Invalid parameter.
- * @retval #ML_ERROR_CANNOT_ASSIGN_ADDRESS Cannot assign object.
  */
 int ml_train_model_get_layer(ml_train_model_h model, const char *layer_name,
                              ml_train_layer_h *layer);
@@ -257,7 +254,6 @@ int ml_train_model_get_layer(ml_train_model_h model, const char *layer_name,
  * @return @c 0 on success. Otherwise a negative error value.
  * @retval #ML_ERROR_NONE Successful.
  * @retval #ML_ERROR_INVALID_PARAMETER Invalid parameter.
- * @retval #ML_ERROR_CANNOT_ASSIGN_ADDRESS Cannot assign object.
  */
 int ml_train_model_get_all_layer_names(ml_train_model_h model,
                                        const char **layers_name[]);
index 2469b7c..5677949 100644 (file)
@@ -90,7 +90,6 @@ template <typename F> static int nntrainer_exception_boundary(F &&func) {
   /**< Exception boundary for specialized error code */
   /// @todo deprecate this with #233
   switch (status) {
-  case ML_ERROR_CANNOT_ASSIGN_ADDRESS:
   case ML_ERROR_BAD_ADDRESS:
     return ML_ERROR_OUT_OF_MEMORY;
   case ML_ERROR_RESULT_OUT_OF_RANGE:
index 9b864bb..1595c3d 100644 (file)
@@ -8,14 +8,17 @@
  * @see        https://github.com/nnstreamer/nntrainer
  * @author Parichay Kapoor <pk.kapoor@samsung.com>
  * @bug No known bugs except for NYI items
- *
- * @note This API is not stable and still experimental.
  */
 
 #ifndef __TIZEN_MACHINELEARNING_NNTRAINER_API_COMMON_H__
 #define __TIZEN_MACHINELEARNING_NNTRAINER_API_COMMON_H__
 
 /**
+ * @addtogroup CAPI_ML_NNTRAINER_TRAIN_MODULE
+ * @{
+ */
+
+/**
  * @brief Dataset generator callback function for train/valid/test data.
  *
  * @details The user of the API must provide this callback function to supply
@@ -33,7 +36,7 @@
  * The order of the inputs/labels, in case of multiple of inputs/labels, will be
  * determined based on the sequence of addition of the input layers to the
  * model.
- * @since_tizen 6.x
+ * @since_tizen 6.0
  * @note This function can be called multiple times in parallel when total
  * number of samples are set as a property for this dataset. In this case, last
  * is only used for verification purposes. If total number of samples for the
@@ -118,7 +121,7 @@ typedef int (*ml_train_datagen_cb)(float **input, float **label, bool *last,
 
 /**
  * @brief Enumeration for the neural network summary verbosity of NNTrainer.
- * @since_tizen 6.x
+ * @since_tizen 6.0
  */
 typedef enum {
   ML_TRAIN_SUMMARY_MODEL = 0, /**< Overview of model
@@ -128,4 +131,8 @@ typedef enum {
                              information */
 } ml_train_summary_type_e;
 
+/**
+ * @}
+ */
+
 #endif /* __TIZEN_MACHINELEARNING_NNTRAINER_API_COMMON_H__ */
index 343ac17..0d2397e 100644 (file)
 #include <ml-api-common.h>
 #if defined(__TIZEN__)
 #include <tizen_error.h>
-#define ML_ERROR_CANNOT_ASSIGN_ADDRESS TIZEN_ERROR_CANNOT_ASSIGN_ADDRESS
 #define ML_ERROR_BAD_ADDRESS TIZEN_ERROR_BAD_ADDRESS
 #define ML_ERROR_RESULT_OUT_OF_RANGE TIZEN_ERROR_RESULT_OUT_OF_RANGE
 #else
 #include <errno.h>
-#define ML_ERROR_CANNOT_ASSIGN_ADDRESS (-EADDRNOTAVAIL)
 #define ML_ERROR_BAD_ADDRESS (-EFAULT)
 #define ML_ERROR_RESULT_OUT_OF_RANGE (-ERANGE)
 #endif