• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #ifndef TENSORFLOW_CORE_COMMON_RUNTIME_BUILD_GRAPH_OPTIONS_H_
17 #define TENSORFLOW_CORE_COMMON_RUNTIME_BUILD_GRAPH_OPTIONS_H_
18 
19 #include <vector>
20 
21 #include "tensorflow/core/graph/collective_order.h"
22 #include "tensorflow/core/platform/types.h"
23 #include "tensorflow/core/protobuf/config.pb.h"
24 
25 namespace tensorflow {
26 
27 struct BuildGraphOptions {
28   CallableOptions callable_options;
29 
30   // If `true`, uses Arg/Retval to implement feeds/fetches; otherwise
31   // uses Recv/Send to implement feeds/fetches.
32   // TODO(mrry): Remove this when the distributed runtime supports Arg/Retval.
33   bool use_function_convention = false;
34 
35   static constexpr int64 kNoCollectiveGraphKey = 0;
36   int64 collective_graph_key = kNoCollectiveGraphKey;
37 
38   // If not `kNone`, order all CollectiveReduce operations statically and
39   // deterministically.  If `kEdges`, encode dependencies as explicit control
40   // edges, if `kAttrs` encode as attribute on collective op.
41   GraphCollectiveOrder collective_order = GraphCollectiveOrder::kNone;
42 
43   string DebugString() const;
44 };
45 
46 }  // namespace tensorflow
47 
48 #endif  // TENSORFLOW_CORE_COMMON_RUNTIME_BUILD_GRAPH_OPTIONS_H_
49