-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Conversation
Signed-off-by: Ningxin <[email protected]>
Signed-off-by: Ningxin <[email protected]>
would you add a test case with shared nn.Module in |
Signed-off-by: Ningxin <[email protected]>
Signed-off-by: Ningxin <[email protected]>
Fix the bug by adding a function called _expand_module_node without touching compressor.py. However, it does give us a reminder that you should be careful when using the name obtained by find_successor to get the corresponding module from the model. |
Signed-off-by: Ningxin <[email protected]>
Signed-off-by: Ningxin <[email protected]>
while modulegraph.find_successors(node): | ||
nodes = modulegraph.find_successors(node) | ||
assert len(nodes) == 1 | ||
node = nodes[0] |
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.
for the previous implementation, this while loop will never end?
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.
In the previous implementation, it does have a directed loop in the graph: relu->liner2, liner2->relu. However, it will not loop forever, because it will fail on "the assert len(nodes) == 1".
In the previous implementation, relu will have two successors (liner2, linear3).
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.
looks great!
Fix the bug mentioned in issue 2485.
In addition, to pass the merge check pipeline, I also fix several pylint warnings.
I visualize the resnet18, resnet34, mobilev2, googlenet, squeezenet1_1 by TorchModuleGraph for testing, and it works fine.