| 169 | } |
| 170 | |
| 171 | void RemoveAttributes(const GraphDef& input_graph_def, |
| 172 | const std::vector<string>& attributes, |
| 173 | GraphDef* output_graph_def) { |
| 174 | output_graph_def->mutable_node()->Clear(); |
| 175 | for (const NodeDef& node : input_graph_def.node()) { |
| 176 | NodeDef* new_node = output_graph_def->mutable_node()->Add(); |
| 177 | *new_node = node; |
| 178 | for (const string& attribute : attributes) { |
| 179 | new_node->mutable_attr()->erase(attribute); |
| 180 | } |
| 181 | } |
| 182 | } |
| 183 | |
| 184 | Status SortByExecutionOrder(const GraphDef& input_graph_def, |
| 185 | GraphDef* output_graph_def) { |