Skip to content

Commit

Permalink
Review comments handled
Browse files Browse the repository at this point in the history
  • Loading branch information
ANSHUMAN TRIPATHY authored and ANSHUMAN TRIPATHY committed May 11, 2020
1 parent 883d823 commit 31296e8
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion include/tvm/ir/attrs.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ class DictAttrs : public Attrs {
* \param dict The attributes.
* \return The dict attributes.
*/
TVM_DLL explicit DictAttrs(Map<String, ObjectRef> dict);
TVM_DLL explicit DictAttrs(Map<std::string, ObjectRef> dict);

TVM_DEFINE_OBJECT_REF_METHODS(DictAttrs, Attrs, DictAttrsNode);
TVM_DEFINE_OBJECT_REF_COW_METHOD(DictAttrsNode);
Expand Down
2 changes: 1 addition & 1 deletion include/tvm/ir/function.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ inline TFunc WithAttr(TFunc func, const std::string& attr_key, ObjectRef attr_va
if (node->attrs.defined()) {
node->attrs.CopyOnWrite()->dict.Set(attr_key, attr_value);
} else {
Map<String, ObjectRef> dict = {{attr_key, attr_value}};
Map<std::string, ObjectRef> dict = {{attr_key, attr_value}};
node->attrs = DictAttrs(dict);
}
return func;
Expand Down
2 changes: 1 addition & 1 deletion include/tvm/runtime/container.h
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ inline String operator+(const std::string lhs, const String& rhs) {
}

inline std::ostream& operator<<(std::ostream& out, const String& input) {
out << input.operator std::string();
out.write(input.data(), input.size());
return out;
}

Expand Down
8 changes: 2 additions & 6 deletions src/ir/attrs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,9 @@ void DictAttrsNode::InitByPackedArgs(const runtime::TVMArgs& args, bool allow_un

Array<AttrFieldInfo> DictAttrsNode::ListFieldInfo() const { return {}; }

DictAttrs::DictAttrs(Map<String, ObjectRef> dict) {
DictAttrs::DictAttrs(Map<std::string, ObjectRef> dict) {
ObjectPtr<DictAttrsNode> n = make_object<DictAttrsNode>();
Map<std::string, ObjectRef> dict_copy;
for (auto iter : dict) {
dict_copy.Set(iter.first.operator std::string(), iter.second);
}
n->dict = std::move(dict_copy);
n->dict = std::move(dict);
data_ = std::move(n);
}

Expand Down

0 comments on commit 31296e8

Please sign in to comment.