Skip to content

Commit

Permalink
[TIR][Printer] text format printer considering future parsing use (#5483
Browse files Browse the repository at this point in the history
)
  • Loading branch information
spectrometerHBH authored May 9, 2020
1 parent 06efa7f commit ae7e0a1
Show file tree
Hide file tree
Showing 9 changed files with 1,765 additions and 739 deletions.
4 changes: 2 additions & 2 deletions include/tvm/ir/module.h
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ TVM_DLL String PrettyPrint(const ObjectRef& node);
* \return The text representation.
*/
TVM_DLL String AsText(const ObjectRef& node,
bool show_meta_data = true,
runtime::TypedPackedFunc<String(ObjectRef)> annotate = nullptr);
bool show_meta_data = true,
runtime::TypedPackedFunc<String(ObjectRef)> annotate = nullptr);
} // namespace tvm
#endif // TVM_IR_MODULE_H_
9 changes: 9 additions & 0 deletions src/printer/meta_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,15 @@ class TextMetaDataContext {
return meta_repr_[node];
}

/*!
* \brief Test whether a node has been put in meta
* \param node The query node
* \return whether the node has been put in meta
*/
bool InMeta(const ObjectRef& node) {
return meta_repr_.find(node) != meta_repr_.end();
}

/*!
* \brief Print a key value pair
*/
Expand Down
Loading

0 comments on commit ae7e0a1

Please sign in to comment.