From b56d0dee007d42cb2ba7245539e3cc8bc480c4ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=BE=E9=9B=A8=E9=AD=94=E7=90=86=E6=B2=99?= Date: Tue, 16 Apr 2019 10:04:36 -0700 Subject: [PATCH 1/2] Update pretty_printer.cc --- src/relay/ir/pretty_printer.cc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/relay/ir/pretty_printer.cc b/src/relay/ir/pretty_printer.cc index f4a830040f70..df7474a9ad2f 100644 --- a/src/relay/ir/pretty_printer.cc +++ b/src/relay/ir/pretty_printer.cc @@ -592,6 +592,22 @@ class PrettyPrinter : return AllocTypeVar(GetRef(node)); } + Doc VisitType_(const GlobalTypeVarNode* node) final { + return Doc(node->var->name_hint); + } + + Doc VisitType_(const TypeCallNode* node) final { + Doc doc = PrintType(node->func, false); + std::vector args; + for (const Type& t : node->args) { + args.push_back(PrintType(t, false)); + } + doc << "("; + doc << PrintVec(args); + doc << ")"; + return doc; + } + Doc VisitType_(const TensorTypeNode* node) final { // scalar type if (node->shape.size() == 0) { From 28b704005d6025998ad803d9baf6a235fd3769df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=BE=E9=9B=A8=E9=AD=94=E7=90=86=E6=B2=99?= Date: Tue, 16 Apr 2019 12:40:08 -0700 Subject: [PATCH 2/2] Update pretty_printer.cc --- src/relay/ir/pretty_printer.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/relay/ir/pretty_printer.cc b/src/relay/ir/pretty_printer.cc index df7474a9ad2f..71502614abd6 100644 --- a/src/relay/ir/pretty_printer.cc +++ b/src/relay/ir/pretty_printer.cc @@ -602,9 +602,9 @@ class PrettyPrinter : for (const Type& t : node->args) { args.push_back(PrintType(t, false)); } - doc << "("; + doc << "["; doc << PrintVec(args); - doc << ")"; + doc << "]"; return doc; }