Skip to content

Commit

Permalink
[Relay] Add printing for ADT Type (#3030)
Browse files Browse the repository at this point in the history
* Update pretty_printer.cc

* Update pretty_printer.cc
  • Loading branch information
MarisaKirisame authored and icemelon committed Apr 17, 2019
1 parent 12257dd commit 4ab97df
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/relay/ir/pretty_printer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,22 @@ class PrettyPrinter :
return AllocTypeVar(GetRef<TypeVar>(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<Doc> 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) {
Expand Down

0 comments on commit 4ab97df

Please sign in to comment.