-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Relay][Text Format] Pretty Printer Smart Inlining #2881
Conversation
e0af3ac
to
853ddbe
Compare
@@ -181,9 +184,9 @@ class PrettyPrinter : | |||
|
|||
Doc PrintAttrs(const Attrs& attrs, const Expr& op); | |||
|
|||
Doc Print(const NodeRef& node, bool meta = false) { | |||
Doc Print(const NodeRef& node, bool meta = false, bool try_inline = false) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make these two member of the language instead of passing them around.
If you pass them around you should change them. If they are constant save yourself the work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are flags for the Print
function and are changed by the callers in specific instances. They are only changed for one invocation of Print
at a time and importantly not for recursive invocations. I think they make the most sense as flags on Print
rather than as instance variables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm.
@joshpoll Please clearly document the start inliner's behavior. Some suggestions:
|
@joshpoll please update this PR |
ff2282d
to
7e558e6
Compare
@tqchen I have updated the PR documenting the inline heuristics. I don't think it's a good idea to add more until we have a better doc model that gives more layout options. |
Thanks, @joshpoll @MarisaKirisame @wweic this is now merged |
to_a_normal_form.cc
.cc @vinx13 @wweic @MarisaKirisame @tqchen