[neurun/api] Comment for nnfw_session (#9137)
author오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Mon, 25 Nov 2019 01:43:16 +0000 (10:43 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Mon, 25 Nov 2019 01:43:16 +0000 (10:43 +0900)
Add more comment for nnfw_session
It contains brief how to use nnfw_session for inference

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

index a1c3841..f1b8a45 100644 (file)
 extern "C" {
 #endif
 
+/**
+ * nnfw_session is session to query with runtime
+ *
+ * <p>nnfw_session is started and passed by calling {@link nnfw_create_session}.
+ * Each session has its own inference environment, such as model to inference, backend usage, etc.
+ *
+ * <p>Load model by calling {@link nnfw_load_model_from_file}
+ *
+ * <p>After loading, prepare inference by calling {@link nnfw_prepare}.
+ * Application can set runtime environment before prepare by calling
+ * {@link nnfw_set_available_backends} and {@link nnfw_set_op_backend}, and it is optional.
+ *
+ * <p>Application can inference by calling {@link nnfw_run}.
+ * Before inference, application has responsibility to set input tensor to set input data by calling
+ * {@link nnfw_set_output}, and output tensor to get output by calling {@link nnfw_set_input}
+ *
+ * <p>To support input and output setting, application can get
+ * input and output tensor information by calling<ul>
+ * <li>{@link nnfw_input_size}</li>
+ * <li>{@link nnfw_output_size}</li>
+ * <li>{@link nnfw_input_tensorinfo}</li>
+ * <li>{@link nnfw_output_tensorinfo}</li>
+ * </ul>
+ *
+ * <p>Application can inference many times using one session,
+ * but next inference can do after prior inference end
+ *
+ * <p>Application cannot use muitiple model using one session
+ */
 typedef struct nnfw_session nnfw_session;
+
 typedef struct nnfw_tensorinfo nnfw_tensorinfo;
 
 typedef enum {