10
10
11
11
#pragma once
12
12
13
+ #include " openvino/c/deprecated.h"
13
14
#include " openvino/c/ov_common.h"
14
15
#include " openvino/c/ov_compiled_model.h"
15
16
#include " openvino/c/ov_model.h"
@@ -173,8 +174,9 @@ ov_core_read_model_unicode(const ov_core_t* core,
173
174
/* *
174
175
* @brief Reads models from IR / ONNX / PDPD / TF / TFLite formats.
175
176
* @ingroup ov_core_c_api
177
+ * @deprecated Use ov_core_read_model_from_memory_buffer instead.
176
178
* @param core A pointer to the ie_core_t instance.
177
- * @param model_str String with a model in IR / ONNX / PDPD / TF / TFLite format.
179
+ * @param model_str String with a model in IR / ONNX / PDPD / TF / TFLite format, string is null-terminated .
178
180
* @param weights Shared pointer to a constant tensor with weights.
179
181
* @param model A pointer to the newly created model.
180
182
* Reading ONNX / PDPD / TF / TFLite models does not support loading weights from the @p weights tensors.
@@ -183,12 +185,35 @@ ov_core_read_model_unicode(const ov_core_t* core,
183
185
* constant data will point to an invalid memory.
184
186
* @return Status code of the operation: OK(0) for success.
185
187
*/
186
- OPENVINO_C_API (ov_status_e)
188
+ OPENVINO_C_API (OPENVINO_DEPRECATED(
189
+ " This API is deprecated and will be replaced by ov_core_read_model_from_memory_buffer" ) ov_status_e)
187
190
ov_core_read_model_from_memory(const ov_core_t * core,
188
191
const char * model_str,
189
192
const ov_tensor_t * weights,
190
193
ov_model_t ** model);
191
194
195
+ /* *
196
+ * @brief Reads models from IR / ONNX / PDPD / TF / TFLite formats with models string size.
197
+ * @ingroup ov_core_c_api
198
+ * @param core A pointer to the ie_core_t instance.
199
+ * @param model_str String with a model in IR / ONNX / PDPD / TF / TFLite format, support model string containing
200
+ * several null chars.
201
+ * @param str_len The length of model string.
202
+ * @param weights Shared pointer to a constant tensor with weights.
203
+ * @param model A pointer to the newly created model.
204
+ * Reading ONNX / PDPD / TF / TFLite models does not support loading weights from the @p weights tensors.
205
+ * @note Created model object shares the weights with the @p weights object.
206
+ * Thus, do not create @p weights on temporary data that can be freed later, since the model
207
+ * constant data will point to an invalid memory.
208
+ * @return Status code of the operation: OK(0) for success.
209
+ */
210
+ OPENVINO_C_API (ov_status_e)
211
+ ov_core_read_model_from_memory_buffer(const ov_core_t * core,
212
+ const char * model_str,
213
+ const size_t str_len,
214
+ const ov_tensor_t * weights,
215
+ ov_model_t ** model);
216
+
192
217
/* *
193
218
* @brief Creates a compiled model from a source model object.
194
219
* Users can create as many compiled models as they need and use
0 commit comments