1 | /* Copyright 2015 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_PUBLIC_SESSION_OPTIONS_H_ |
17 | #define TENSORFLOW_CORE_PUBLIC_SESSION_OPTIONS_H_ |
18 | |
19 | #include <string> |
20 | |
21 | #include "tensorflow/core/platform/types.h" |
22 | #include "tensorflow/core/protobuf/config.pb.h" |
23 | |
24 | namespace tsl { |
25 | class Env; |
26 | } // namespace tsl |
27 | namespace tensorflow { |
28 | |
29 | /// Configuration information for a Session. |
30 | struct SessionOptions { |
31 | /// The environment to use. |
32 | tsl::Env* env; |
33 | |
34 | /// \brief The TensorFlow runtime to connect to. |
35 | /// |
36 | /// If 'target' is empty or unspecified, the local TensorFlow runtime |
37 | /// implementation will be used. Otherwise, the TensorFlow engine |
38 | /// defined by 'target' will be used to perform all computations. |
39 | /// |
40 | /// "target" can be either a single entry or a comma separated list |
41 | /// of entries. Each entry is a resolvable address of the |
42 | /// following format: |
43 | /// local |
44 | /// ip:port |
45 | /// host:port |
46 | /// ... other system-specific formats to identify tasks and jobs ... |
47 | /// |
48 | /// NOTE: at the moment 'local' maps to an in-process service-based |
49 | /// runtime. |
50 | /// |
51 | /// Upon creation, a single session affines itself to one of the |
52 | /// remote processes, with possible load balancing choices when the |
53 | /// "target" resolves to a list of possible processes. |
54 | /// |
55 | /// If the session disconnects from the remote process during its |
56 | /// lifetime, session calls may fail immediately. |
57 | std::string target; |
58 | |
59 | /// Configuration options. |
60 | ConfigProto config; |
61 | |
62 | SessionOptions(); |
63 | }; |
64 | |
65 | } // end namespace tensorflow |
66 | |
67 | #endif // TENSORFLOW_CORE_PUBLIC_SESSION_OPTIONS_H_ |
68 | |