Skip to content

Commit

Permalink
Fix read_model deduction issue
Browse files Browse the repository at this point in the history
Signed-off-by: Raasz, Pawel <[email protected]>
  • Loading branch information
praasz committed Dec 13, 2024
1 parent fb2861c commit 0d3c3af
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
11 changes: 6 additions & 5 deletions src/inference/include/openvino/runtime/core.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,12 @@ class OPENVINO_RUNTIME_API Core {
* * PDPD (*.pdmodel)
* * TF (*.pb)
* * TFLite (*.tflite)
* @param properties Optional map of pairs: (property name, property value) relevant only for this read operation.
* @return A model.
*/
std::shared_ptr<ov::Model> read_model(const std::wstring& model_path, const std::wstring& bin_path = {}) const;
std::shared_ptr<ov::Model> read_model(const std::wstring& model_path,
const std::wstring& bin_path = {},
const ov::AnyMap& properties = {}) const;
#endif

/**
Expand All @@ -108,9 +111,7 @@ class OPENVINO_RUNTIME_API Core {

#ifdef OPENVINO_CPP_VER_17
template <class Path, std::enable_if_t<std::is_same_v<Path, std::filesystem::path>>* = nullptr>
std::shared_ptr<ov::Model> read_model(const Path& model_path,
const Path& bin_path = {},
const ov::AnyMap& properties = {}) const {
auto read_model(const Path& model_path, const Path& bin_path = {}, const ov::AnyMap& properties = {}) const {
return read_model(model_path.string(), bin_path.string(), properties);
}
#endif
Expand Down Expand Up @@ -142,7 +143,7 @@ class OPENVINO_RUNTIME_API Core {

#ifdef OPENVINO_CPP_VER_17
template <class Path, class... Properties, std::enable_if_t<std::is_same_v<Path, std::filesystem::path>>* = nullptr>
auto read_model(const Path& model_path, const Path& bin_path = {}, Properties&&... properties) const {
auto read_model(const Path& model_path, const Path& bin_path, Properties&&... properties) const {
return read_model(model_path.string(), bin_path.string(), std::forward<Properties>(properties)...);
}
#endif
Expand Down
9 changes: 6 additions & 3 deletions src/inference/src/cpp/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,12 @@ Core::Core(const std::string& xml_config_file) {
std::map<std::string, Version> Core::get_versions(const std::string& device_name) const {
OV_CORE_CALL_STATEMENT({ return _impl->get_versions(device_name); })}
#ifdef OPENVINO_ENABLE_UNICODE_PATH_SUPPORT
std::shared_ptr<ov::Model> Core::read_model(const std::wstring& model_path, const std::wstring& bin_path) const {
OV_CORE_CALL_STATEMENT(
return _impl->read_model(ov::util::wstring_to_string(model_path), ov::util::wstring_to_string(bin_path), {}););
std::shared_ptr<ov::Model> Core::read_model(const std::wstring& model_path,
const std::wstring& bin_path,
const ov::AnyMap& properties) const {
OV_CORE_CALL_STATEMENT(return _impl->read_model(ov::util::wstring_to_string(model_path),
ov::util::wstring_to_string(bin_path),
properties););
}
#endif

Expand Down

0 comments on commit 0d3c3af

Please sign in to comment.