-
Notifications
You must be signed in to change notification settings - Fork 6.8k
[MXNET-749] Correct usages of CutSubgraph
in 3 control flow operators
#12078
Changes from 2 commits
29abfbb
031b8f1
09af6d9
54943d9
4b58be1
9fdeba5
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 |
---|---|---|
|
@@ -1225,6 +1225,9 @@ static bool BackwardCondStorageType(const nnvm::NodeAttrs& attrs, | |
CHECK(sync_in_in(input_locs, out_attrs, &subg_out_attrs, is_udf)); | ||
return ret; | ||
}; | ||
for (const dim_t &cond_in : params.cond_input_locs) { | ||
(*out_attrs)[cond_in] = 0; | ||
} | ||
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. what is this for? 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.
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. Is 0 a magic number? 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. @eric-haibin-lin In this case, anything other than 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. Okay I updated "0 => kUndefinedStorage" |
||
bool succ_0 = sub_pass(attrs.subgraphs[1], params.then_input_locs); | ||
bool succ_1 = sub_pass(attrs.subgraphs[2], params.else_input_locs); | ||
return succ_0 && succ_1; | ||
|
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.
what happens if
o
doesn't have__subgraph_name__
?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
dict.get(key, defaultvalue)
will return youdefaultvalue
ifkey
doesn't exist