• 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_EXECUTOR_FACTORY_H_
17 #define TENSORFLOW_CORE_COMMON_RUNTIME_EXECUTOR_FACTORY_H_
18 
19 #include <string>
20 
21 #include "tensorflow/core/lib/core/errors.h"
22 #include "tensorflow/core/lib/core/status.h"
23 #include "tensorflow/core/lib/gtl/array_slice.h"
24 #include "tensorflow/core/platform/types.h"
25 
26 namespace tensorflow {
27 
28 class Executor;
29 class Graph;
30 struct LocalExecutorParams;
31 
32 class ExecutorFactory {
33  public:
34   virtual Status NewExecutor(const LocalExecutorParams& params,
35                              const Graph& graph,
36                              std::unique_ptr<Executor>* out_executor) = 0;
~ExecutorFactory()37   virtual ~ExecutorFactory() {}
38 
39   static void Register(const string& executor_type, ExecutorFactory* factory);
40   static Status GetFactory(const string& executor_type,
41                            ExecutorFactory** out_factory);
42 };
43 
44 Status NewExecutor(const string& executor_type,
45                    const LocalExecutorParams& params, const Graph& graph,
46                    std::unique_ptr<Executor>* out_executor);
47 
48 }  // namespace tensorflow
49 
50 #endif  // TENSORFLOW_CORE_COMMON_RUNTIME_EXECUTOR_FACTORY_H_
51