|
|
|
@@ -2506,7 +2506,6 @@ Status TensorFlowModelParser::OptimizeIdentityByOutput(map<string, NodeDef *> &n |
|
|
|
// Deal with non _Retval output operator of Identity. |
|
|
|
if (has_out_retval) { |
|
|
|
std::map<std::string, std::vector<std::pair<int32_t, int32_t>>>::const_iterator output_iter = output_map.begin(); |
|
|
|
GELOGD("[test]map size:%u.", output_map.size()); |
|
|
|
for (; output_iter != output_map.end(); ++output_iter) { |
|
|
|
const string &output_node_name = output_iter->first; |
|
|
|
GELOGD("[test]node name:%s.", output_node_name.c_str()); |
|
|
|
@@ -2516,9 +2515,13 @@ Status TensorFlowModelParser::OptimizeIdentityByOutput(map<string, NodeDef *> &n |
|
|
|
GE_IF_BOOL_EXEC(output_node_def->op() == "_Retval", continue); |
|
|
|
for (int k = 0; k < output_node_def->input_size(); ++k) { |
|
|
|
GELOGD("[test]input name:%s, curr_node_name:%s.", output_node_def->input(k).c_str(), curr_node_name.c_str()); |
|
|
|
bool is_control = false; |
|
|
|
string node_name; |
|
|
|
GE_RETURN_IF_ERROR(CheckInputNodeName(output_node_def->input(k), &node_name, nullptr, &is_control)); |
|
|
|
|
|
|
|
GE_IF_BOOL_EXEC( |
|
|
|
output_node_def->input(k) == curr_node_name, output_node_def->set_input(k, curr_node_def->input(0).c_str()); |
|
|
|
GELOGD("%s op set input(%d):%s.", output_node_def->name().c_str(), k, curr_node_def->input(0).c_str());) |
|
|
|
node_name == curr_node_name, output_node_def->set_input(k, is_control ? ("^" + curr_node_def->input(0).c_str()) : curr_node_def->input(0).c_str()); |
|
|
|
GELOGD("%s op set input(%d):%s, is_control:%d.", output_node_def->name().c_str(), k, curr_node_def->input(0).c_str(), is_control);) |
|
|
|
} |
|
|
|
} |
|
|
|
clear_input_flag = true; |
|
|
|
|