| 128 | } |
| 129 | |
| 130 | Status TopologicalSort(GraphDef* graph) { |
| 131 | std::vector<int> ready_nodes; |
| 132 | TF_RETURN_IF_ERROR(ComputeTopologicalOrder(*graph, {}, &ready_nodes)); |
| 133 | PermuteNodesInPlace(graph, &ready_nodes, /*invert_permutation=*/true); |
| 134 | return Status::OK(); |
| 135 | } |
| 136 | |
| 137 | } // namespace grappler |
| 138 | } // namespace tensorflow |