• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_COMMON_RUNTIME_LOCAL_EXECUTOR_PARAMS_H_
17 #define TENSORFLOW_CORE_COMMON_RUNTIME_LOCAL_EXECUTOR_PARAMS_H_
18 
19 #include <functional>
20 #include <memory>
21 
22 namespace tensorflow {
23 
24 class Device;
25 class StepStatsCollector;
26 class SessionMetadata;
27 class FunctionLibraryRuntime;
28 class NodeProperties;
29 class OpKernel;
30 class Status;
31 
32 // LocalExecutorParams provides arguments that will be shared by all invocations
33 // of an executor. We expect that different contexts would provide different
34 // implementations (e.g. local versus distributed).
35 struct LocalExecutorParams {
36   Device* device;
37 
38   const SessionMetadata* session_metadata = nullptr;
39 
40   // The library runtime support.
41   FunctionLibraryRuntime* function_library = nullptr;
42 
43   // create_kernel returns an instance of op kernel based on NodeDef.
44   // delete_kernel is called for every kernel used by the executor
45   // when the executor is deleted.
46   std::function<Status(const std::shared_ptr<const NodeProperties>&,
47                        OpKernel**)>
48       create_kernel;
49   std::function<void(OpKernel*)> delete_kernel;
50 
51   // Whether control flow nodes are allowed to be executed synchronously.
52   bool allow_control_flow_sync_execution = false;
53 };
54 
55 }  // end namespace tensorflow
56 
57 #endif  // TENSORFLOW_CORE_COMMON_RUNTIME_LOCAL_EXECUTOR_PARAMS_H_
58