xref: /aosp_15_r20/external/tensorflow/tensorflow/c/eager/c_api_internal.h (revision b6fb3261f9314811a0f4371741dbb8839866f948)
1 /* Copyright 2017 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 #ifndef TENSORFLOW_C_EAGER_C_API_INTERNAL_H_
16 #define TENSORFLOW_C_EAGER_C_API_INTERNAL_H_
17 
18 #include "tensorflow/c/c_api_internal.h"
19 #include "tensorflow/c/eager/c_api.h"
20 #include "tensorflow/c/eager/c_api_experimental.h"
21 #include "tensorflow/c/eager/tfe_cancellation_manager_internal.h"  // IWYU pragma: export
22 #include "tensorflow/c/eager/tfe_executor_internal.h"  // IWYU pragma: export
23 #include "tensorflow/c/eager/tfe_monitoring_internal.h"  // IWYU pragma: export
24 #include "tensorflow/c/eager/tfe_op_attrs_internal.h"  // IWYU pragma: export
25 #include "tensorflow/c/eager/tfe_tensor_debug_info_internal.h"  // IWYU pragma: export
26 
27 // TODO(b/154564140): Move this to its own header. This requires splitting
28 // c_api_experimental.h
29 struct TFE_ContextOptions {
30   TF_SessionOptions session_options;
31   // true if async execution is enabled.
32   bool async = false;
33   TFE_ContextDevicePlacementPolicy device_placement_policy{
34       TFE_DEVICE_PLACEMENT_SILENT};
35   // If true, use TFRT backend
36   bool use_tfrt = false;
37   // This option is effective only when use_tfrt is true. If true, TFRT will use
38   // native TFRT distributed runtime. Otherwise, TFRT will use current runtime's
39   // distributed runtime. Note that TFRT distributed runtime is in development
40   // and not functionally complete.
41   bool use_tfrt_distributed_runtime = false;
42   // Whether to run elementary eager ops wrapped in a call op.
43   bool run_eager_op_as_function = false;
44   // Whether to rewrite jit_compile functions.
45   bool jit_compile_rewrite = false;
46 };
47 
48 #endif  // TENSORFLOW_C_EAGER_C_API_INTERNAL_H_
49