Commit 4ab97dfa by 雾雨魔理沙 Committed by Haichen Shen

[Relay] Add printing for ADT Type (#3030)

* Update pretty_printer.cc

* Update pretty_printer.cc
parent 12257ddd
......@@ -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) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment