This repository has been 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.8k
[MXNET-795] Fix a bug that CutSubgraph works only when each subgraph has its distinct name #12106
Merged
Conversation
This file contains 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
junrushao
changed the title
Fix a bug that CutSubgraph works only when each subgraph has its distinct name
[MXNET-795] Fix a bug that CutSubgraph works only when each subgraph has its distinct name
Aug 9, 2018
It should be merged after #12078 |
junrushao
force-pushed
the
fix-subgraph-duplicate-scope
branch
from
August 9, 2018 16:20
2d7ffe2
to
20e1eb6
Compare
junrushao
force-pushed
the
fix-subgraph-duplicate-scope
branch
from
August 10, 2018 20:53
94c2037
to
6c44770
Compare
@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) |
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?
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.
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
Could we get this merged? @zheng-da |
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
CutSubgraph
works 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_names
intoAttrScope
as static member.Comments
CutSubgraph
in 3 control flow operators #12078, which is another bug related to cutting subgraphs.