File tree 2 files changed +9
-0
lines changed
2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ itex_xpu_library(
9
9
":libitex_common" ,
10
10
"//itex/core/devices:device_backend_util_hdr" ,
11
11
"//itex/core/kernels/common:no_ops" ,
12
+ "@local_config_python//:python_headers" ,
12
13
"@local_config_tf//:tf_header_lib" ,
13
14
] + select ({
14
15
"@local_config_dpcpp//dpcpp:using_dpcpp" : [
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ limitations under the License.
15
15
16
16
#include < string>
17
17
18
+ #include " Python.h"
18
19
#include " itex/core/devices/device_backend_util.h"
19
20
#include " itex/core/devices/xpu_device_util.h"
20
21
#include " itex/core/kernels/common.h"
@@ -52,4 +53,11 @@ void TF_InitKernel() {
52
53
// Register generic CPU kernels.
53
54
RegisterCPUKernels (itex::DEVICE_CPU);
54
55
#endif
56
+ bool ops_override = false ;
57
+ ITEX_CHECK_OK (
58
+ itex::ReadBoolFromEnvVar (" ITEX_OPS_OVERRIDE" , false , &ops_override));
59
+ if (ops_override) {
60
+ PyRun_SimpleString (" import intel_extension_for_tensorflow as itex;\n " );
61
+ PyRun_SimpleString (" itex.experimental_ops_override();\n " );
62
+ }
55
63
}
You can’t perform that action at this time.
0 commit comments