Commit 259aa46e by Andrew Tulloch Committed by Haichen Shen

Truncate function name (#2863)

parent 9f7dfd83
......@@ -81,7 +81,16 @@ class ScheduleGetter :
}
readable_name_stream_ << "fused";
cache_node->outputs = this->VisitExpr(prim_func->body);
cache_node->func_name = readable_name_stream_.str();
auto candidate_name = readable_name_stream_.str();
constexpr static size_t kMaxFuncNameLength = 80;
if (candidate_name.size() > kMaxFuncNameLength) {
std::stringstream truncated_name;
truncated_name << candidate_name.substr(0, kMaxFuncNameLength);
truncated_name << "_" << std::hash<std::string>{}(candidate_name) << "_";
candidate_name = truncated_name.str();
}
cache_node->func_name = candidate_name;
CachedFunc cfunc(cache_node);
CHECK(master_op_.defined());
// Fusion over tupled results may leave identity relationships
......
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