From 853ddbe73f630de01431661dcc50b3fcbc5fedf6 Mon Sep 17 00:00:00 2001 From: Josh Pollock Date: Fri, 22 Mar 2019 15:50:04 -0700 Subject: [PATCH] remove GNF flag and debug printer --- python/tvm/relay/ir_pass.py | 32 -------------------------------- src/relay/ir/pretty_printer.cc | 23 ++++------------------- 2 files changed, 4 insertions(+), 51 deletions(-) diff --git a/python/tvm/relay/ir_pass.py b/python/tvm/relay/ir_pass.py index f3f8fea974127..12b6ec8ca8e27 100644 --- a/python/tvm/relay/ir_pass.py +++ b/python/tvm/relay/ir_pass.py @@ -905,35 +905,3 @@ def eliminate_common_subexpr(expr, fskip=None): The output expression. """ return _ir_pass.eliminate_common_subexpr(expr, fskip) - - -def pass_debug_print(ast, show_meta_data=True, annotate=None, gnf=True): - """ - THIS SHOULD BE USED ONLY FOR DEBUGGING, NOT AS AN INTERCHANGE FORMAT! - USE `.astext()` INSTEAD! - - A version of the pretty printer intended for debugging passes. Contains - advanced printing options. - - Parameters - ---------- - ast : Union[relay.Expr, relay.Module, relay.Type] - The relay fragment to be turned into text. - - show_meta_data : bool - Whether to include meta data section in the text - if there is meta data. - - annotate: Optional[relay.Expr->str] - Optional annotate function to provide additional - information in the comment block. - - gnf : bool - Whether to print in GNF. If it is disabled, pointers are left implicit. - - Returns - ------- - text : str - A text representation of `ast`. - """ - return _ir_pass.pass_debug_print(ast, show_meta_data, annotate, gnf) diff --git a/src/relay/ir/pretty_printer.cc b/src/relay/ir/pretty_printer.cc index b37247c999421..a337b94d6d508 100644 --- a/src/relay/ir/pretty_printer.cc +++ b/src/relay/ir/pretty_printer.cc @@ -117,8 +117,7 @@ class PrettyPrinter : public TypeFunctor, public AttrFunctor { public: - explicit PrettyPrinter(bool GNF, - bool show_meta_data, + explicit PrettyPrinter(bool show_meta_data, runtime::TypedPackedFunc annotate) : show_meta_data_(show_meta_data), annotate_(annotate) {} @@ -703,25 +702,17 @@ Doc PrettyPrinter::PrintAttrs(const Attrs& attrs, const Expr& op) { std::string PrettyPrint_(const NodeRef& node, bool show_meta_data, - runtime::TypedPackedFunc annotate, - bool gnf) { + runtime::TypedPackedFunc annotate) { Doc doc; doc << "v0.0.1" << "\n" - << PrettyPrinter(gnf, show_meta_data, annotate).PrintFinal(node); + << PrettyPrinter(show_meta_data, annotate).PrintFinal(node); return doc.str(); } std::string RelayPrint(const NodeRef& node, bool show_meta_data, runtime::TypedPackedFunc annotate) { - return PrettyPrint_(node, show_meta_data, annotate, true); -} - -std::string PassDebugPrint(const NodeRef& node, - bool show_meta_data, - runtime::TypedPackedFunc annotate, - bool gnf) { - return PrettyPrint_(node, show_meta_data, annotate, gnf); + return PrettyPrint_(node, show_meta_data, annotate); } TVM_REGISTER_API("relay._expr.RelayPrint") @@ -729,11 +720,5 @@ TVM_REGISTER_API("relay._expr.RelayPrint") bool, runtime::TypedPackedFunc)>(RelayPrint); -TVM_REGISTER_API("relay._ir_pass.pass_debug_print") -.set_body_typed, - bool)>(PassDebugPrint); - } // namespace relay } // namespace tvm