Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
remove subgraph_name
Browse files Browse the repository at this point in the history
  • Loading branch information
zheng-da committed May 22, 2018
1 parent ae9340d commit 977f562
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
19 changes: 9 additions & 10 deletions python/mxnet/symbol/contrib.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,16 +187,15 @@ def check_data(inputs, in_type, msg):
# the python function, we need to prune the computation graph constructed from
# the function. One way of doing it is to mark the nodes in the computation graph
# with AttrScope and prune the nodes without the special attribute.
with AttrScope(subgraph_name=name):
if isinstance(data, list):
in_eles = [symbol.var(sym.name) for sym in data]
else:
in_eles = symbol.var(data.name)
if isinstance(init_states, list):
states = [symbol.var(s.name) for s in init_states]
else:
states = symbol.var(init_states.name)
sym_out, sym_states = body(in_eles, states)
if isinstance(data, list):
in_eles = [symbol.var(sym.name) for sym in data]
else:
in_eles = symbol.var(data.name)
if isinstance(init_states, list):
states = [symbol.var(s.name) for s in init_states]
else:
states = symbol.var(init_states.name)
sym_out, sym_states = body(in_eles, states)

check_data(sym_out, symbol.Symbol, "the output should be an NDArray or a list of NDArrays")
check_data(sym_states, symbol.Symbol,
Expand Down
5 changes: 2 additions & 3 deletions src/c_api/c_api_symbolic.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,10 @@ void RegisterLegacyOpProp();
void RegisterLegacyNDFunc();
}
const std::vector<std::string> kHiddenKeys = {
"ctx_group", "lr_mult", "wd_mult", "force_mirroring", "mirror_stage", "subgraph_name"
"ctx_group", "lr_mult", "wd_mult", "force_mirroring", "mirror_stage"
};
const std::vector<std::string> kReplacedHiddenKeys = {
"__ctx_group__", "__lr_mult__", "__wd_mult__", "__force_mirroring__", "__mirror_stage__",
"subgraph_name"
"__ctx_group__", "__lr_mult__", "__wd_mult__", "__force_mirroring__", "__mirror_stage__"
};
const char *kNamespaceSeparator = "$";

Expand Down

0 comments on commit 977f562

Please sign in to comment.