1 | /* Copyright 2016 The TensorFlow Authors. All Rights Reserved. |
---|---|
2 | |
3 | Licensed under the Apache License, Version 2.0 (the "License"); |
4 | you may not use this file except in compliance with the License. |
5 | You may obtain a copy of the License at |
6 | |
7 | http://www.apache.org/licenses/LICENSE-2.0 |
8 | |
9 | Unless required by applicable law or agreed to in writing, software |
10 | distributed under the License is distributed on an "AS IS" BASIS, |
11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
12 | See the License for the specific language governing permissions and |
13 | limitations under the License. |
14 | ==============================================================================*/ |
15 | |
16 | #include "tensorflow/core/common_runtime/constant_folding.h" |
17 | #include "tensorflow/core/common_runtime/graph_constructor.h" |
18 | #include "tensorflow/core/graph/node_builder.h" |
19 | #include "tensorflow/core/graph/subgraph.h" |
20 | #include "tensorflow/core/platform/init_main.h" |
21 | #include "tensorflow/core/public/session.h" |
22 | #include "tensorflow/tools/graph_transforms/fold_constants_lib.h" |
23 | #include "tensorflow/tools/graph_transforms/transform_utils.h" |
24 | |
25 | namespace tensorflow { |
26 | namespace graph_transforms { |
27 | |
28 | // This is a thin wrapper with the standard TransformFunc interface to the |
29 | // underlying utility function. The only difference is that we don't use the |
30 | // input or output name arguments. |
31 | Status SortByExecutionOrderWithUnusedContext( |
32 | const GraphDef& input_graph_def, const TransformFuncContext& unused_context, |
33 | GraphDef* output_graph_def) { |
34 | return SortByExecutionOrder(input_graph_def, output_graph_def); |
35 | } |
36 | |
37 | REGISTER_GRAPH_TRANSFORM("sort_by_execution_order", |
38 | SortByExecutionOrderWithUnusedContext); |
39 | |
40 | } // namespace graph_transforms |
41 | } // namespace tensorflow |
42 |