-
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][RFC] Modify repr to return a valid Python AST #2631
Comments
@jroesch can you elaborate and give an example? |
My goal is to obtain a program fragment like:
Instead of:
Upon further reflection we could just do this in Python, though there are some challenges due to our name representation. My main goal is that we could obtain textual representation of the program which can be copy-and pasted back into the interpreter along the idea presented by the My inspiration is that I was writing tests and debugging some transformations and it would be nice to be able to easily manually edit the AST to observe changes instead of having to write a Relay program to do so. |
Do you think it's worth integrating this code with the text printer? We could e.g. reuse the Doc ADT in #2605. |
+1. It would be very useful to have |
close due to inactive status |
I think we should update
repr
and by extension the debug printing methods defined in C++ to update a valid Python AST. This would make it possible for us to extract the debug representation when printing it and paste it into a Python file to edit and modify.I think this will be very useful for experimenting and debugging.
cc @joshpoll @wweic @tqchen @MarisaKirisame
The text was updated successfully, but these errors were encountered: