Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TIR][Printer] text format printer considering future parsing use #5483

Merged
merged 10 commits into from
May 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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