-
Notifications
You must be signed in to change notification settings - Fork 16
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
[Op] Print #81
[Op] Print #81
Conversation
I'm actually thinking some non-intrusive ways to print the intermediate output. Otherwise, users still need to modify the model itself. |
For example, can we add a |
tests/test_op.py
Outdated
self.print = op.Print() | ||
|
||
def forward(self, x): | ||
out = self.lienar(x) + x |
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.
self.linear
This also creates some limitations. For example, you cannot print intermediate results inside a module but just its final output. We could maybe design a primitive only for traced GraphModule, but in this case users still have to use |
I can think of two ways for now:
|
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.
@comaniac We can merge for now and improve this feature later.
Sure please go ahead and merge then. |
Thanks |
Description
This PR introduces a utility op
op.Print
that prints intermediate results for traced modules. A unit test and tutorial are also provided.Checklist
cc @chhzh123 @zarzen