[PyOV] Add new types to Any dispatcher (#15052)

This commit is contained in:
Jan Iwaszkiewicz 2023-01-12 22:43:22 +01:00 committed by GitHub
parent 9e3b52eee0
commit 45934143e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -34,6 +34,8 @@ py::object from_ov_any(const ov::Any& any) {
// Check for unsigned int
else if (any.is<unsigned int>()) {
return py::cast(any.as<unsigned int>());
} else if (any.is<uint64_t>()) {
return py::cast(any.as<uint64_t>());
}
// Check for float
else if (any.is<float>()) {
@ -85,6 +87,14 @@ py::object from_ov_any(const ov::Any& any) {
else if (any.is<std::map<std::string, int>>()) {
return py::cast(any.as<std::map<std::string, int>>());
}
// Check for std::map<std::string, uint64_t>
else if (any.is<std::map<std::string, uint64_t>>()) {
return py::cast(any.as<std::map<std::string, uint64_t>>());
}
// Check for std::map<element::Type, float>
else if (any.is<std::map<ov::element::Type, float>>()) {
return py::cast(any.as<std::map<ov::element::Type, float>>());
}
// Check for std::vector<ov::PropertyName>
else if (any.is<std::vector<ov::PropertyName>>()) {
auto val = any.as<std::vector<ov::PropertyName>>();