-
Notifications
You must be signed in to change notification settings - Fork 70
Add Fusion.print, which prints the transforms as well as the math #5499
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -186,6 +186,16 @@ Returns | |
| ------- | ||
| str | ||
| The fusion intermediate representation (IR) as a string. | ||
| )") | ||
| .def( | ||
| "print", | ||
| [](Fusion& f) { f.print(std::cout); }, | ||
| R"( | ||
| Print the fusion, including transforms, to stdout. | ||
|
|
||
| Returns | ||
| ------- | ||
| None | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I saw other
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Returning a string is nice, so you can search through it in tests. You could map CPP |
||
| )") | ||
| .def( | ||
| "print_kernel", | ||
|
|
||
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.
style: inconsistent return behavior -
print_mathandprint_kernelboth return strings by capturing output in a stringstream, but this newprintmethod prints directly to stdout and returns None. Consider making it consistent: