This repository was archived by the owner on Nov 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
[MXNET-795] Fix a bug that CutSubgraph works only when each subgraph has its distinct name #12106
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 tasks
Member
Author
|
It should be merged after #12078 |
2d7ffe2 to
20e1eb6
Compare
Member
Author
94c2037 to
6c44770
Compare
Member
Author
|
@zheng-da Could we get this fix merged? |
zheng-da
reviewed
Aug 11, 2018
| name="my_cond", | ||
| ) | ||
| return new_data | ||
| AttrScope._subgraph_names = defaultdict(int) |
Contributor
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.
do we need to define this?
Member
Author
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.
@zheng-da Note that _subgraph_names are more like a global variable, I add this in case it is changed in other testcases.
Contributor
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.
good point.
zheng-da
approved these changes
Aug 11, 2018
Member
Author
|
Could we get this merged? @zheng-da |
Member
Author
|
Thank you guys for helping with this PR! |
XinYao1994
pushed a commit
to XinYao1994/incubator-mxnet
that referenced
this pull request
Aug 29, 2018
…has its distinct name (apache#12106) * Copy only when necessary * Fix typo * Add unittest
anirudh2290
pushed a commit
to anirudh2290/mxnet
that referenced
this pull request
Sep 19, 2018
…has its distinct name (apache#12106) * Copy only when necessary * Fix typo * Add unittest
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes a bug in assigning names of subgraphs. The
CutSubgraphworks as expected only when each subgraph has its unique name.This PR ensures it by creating a global dict in
AttrScope, which is pretty ugly though. I am not aware of any other solutions that could ensure a set of strings to be unique globally. If there is better solution, please let me know. Thanks!Checklist
Essentials
Please feel free to remove inapplicable items for your PR.
Changes
_subgraph_namesintoAttrScopeas static member.Comments
CutSubgraphin 3 control flow operators #12078, which is another bug related to cutting subgraphs.