File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 6
6
7
7
#include < limits>
8
8
#include < string>
9
+ #include " openvino/util/common_util.hpp"
9
10
namespace {
10
11
template <class Container >
11
12
bool contains_type_index (Container&& types, const std::type_info& user_type) {
@@ -200,9 +201,14 @@ namespace util {
200
201
void Read<bool >::operator ()(std::istream& is, bool & value) const {
201
202
std::string str;
202
203
is >> str;
203
- if (str == " YES" ) {
204
+
205
+ std::set<std::string> off = {" 0" , " false" , " off" , " no" };
206
+ std::set<std::string> on = {" 1" , " true" , " on" , " yes" };
207
+ str = util::to_lower (str);
208
+
209
+ if (on.count (str)) {
204
210
value = true ;
205
- } else if (str == " NO " ) {
211
+ } else if (off. count ( str) ) {
206
212
value = false ;
207
213
} else {
208
214
OPENVINO_THROW (" Could not convert to bool from string " + str);
You can’t perform that action at this time.
0 commit comments