Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c4840e9

Browse files
Use a forward declaration to avoid tpu_system_interface depending on c_api.
(interface should not depend on implementation) PiperOrigin-RevId: 446007965
1 parent 2b854a7 commit c4840e9

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

tensorflow/dtensor/cc/BUILD

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ cc_library(
142142
srcs = ["tpu_system_interface.cc"],
143143
hdrs = ["tpu_system_interface.h"],
144144
deps = [
145-
"//tensorflow/c/eager:c_api",
146145
"//tensorflow/core:framework",
147146
"//tensorflow/core:lib",
148147
"@com_google_absl//absl/time",

tensorflow/dtensor/cc/tpu_system_interface.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,14 @@ limitations under the License.
1919
#include <vector>
2020

2121
#include "absl/time/time.h"
22-
#include "tensorflow/c/eager/c_api.h"
2322
#include "tensorflow/core/framework/op_kernel.h"
2423
#include "tensorflow/core/framework/resource_mgr.h"
2524
#include "tensorflow/core/platform/logging.h"
2625
#include "tensorflow/core/platform/status.h"
2726

27+
// Forward declare TFE_Context to avoid interface depending on c_api.
28+
typedef struct TFE_Context TFE_Context;
29+
2830
namespace tensorflow {
2931
namespace dtensor {
3032

0 commit comments

Comments
 (0)