diff --git a/nnvm/include/nnvm/tuple.h b/nnvm/include/nnvm/tuple.h index b3193ca29eb8..551300b277ca 100644 --- a/nnvm/include/nnvm/tuple.h +++ b/nnvm/include/nnvm/tuple.h @@ -202,8 +202,6 @@ class Tuple { if (it != begin) os << ','; os << *it; } - // python style tuple - if (t.ndim() == 1) os << ','; os << ']'; return os; } diff --git a/nnvm/python/nnvm/top/attr_dict.py b/nnvm/python/nnvm/top/attr_dict.py index b5baf3decbde..2c37a0e40d6a 100644 --- a/nnvm/python/nnvm/top/attr_dict.py +++ b/nnvm/python/nnvm/top/attr_dict.py @@ -94,7 +94,17 @@ def get_bool(self, key): value : bool The result value """ - return self[key] != "False" + lowercase = self[key].lower() + if lowercase == "1": + return True + elif lowercase == "0": + return False + elif lowercase == "true": + return True + elif lowercase == "false": + return False + else: + raise ValueError("Wrong bool format for key %s" % key) def __repr__(self): return str({k : self[k] for k in self.keys()})