-
Notifications
You must be signed in to change notification settings - Fork 24
Move rename_tensor to function_hook #136
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
Changes from 1 commit
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 |
---|---|---|
|
@@ -174,6 +174,17 @@ def backward_postprocess(self, function, in_data, out_grad): | |
self.converted_nodes[temp_node_name] = nodes | ||
|
||
def deleted(self, function=None): | ||
"""Rename output names. | ||
|
||
When renaming an output name, another node can reference the same value | ||
as input, so the input name must be renamed at once. So this renaming | ||
process should be run after all functions are converted and this | ||
`deleted` function is called when function hook is done, means | ||
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. How about "which means all functions are converted"? 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. fixed, thx |
||
completed functions converting. | ||
|
||
If input/output name is given by externally, these given names take | ||
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. Maybe: "names are given externally" 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. fixed, thx |
||
priority over named by this process. | ||
""" | ||
func_name_counts = collections.defaultdict(int) | ||
names = {} | ||
for temp_func_name, nodes in reversed(self.converted_nodes.items()): | ||
|
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.
Could you add a brief comment to explain why we need to use
deleted
?