Split out TF_Status into a separate header file so that other C API libraries

can depend on it without depending on c_api_internal.

PiperOrigin-RevId: 251948141
This commit is contained in:
Anna R 2019-06-06 16:12:09 -07:00 committed by TensorFlower Gardener
parent e691be7814
commit 907e1baf6e
7 changed files with 55 additions and 11 deletions

View File

@ -58,7 +58,6 @@ tf_cuda_library(
"c_api.h",
"c_api_internal.h",
"tf_datatype.h",
"tf_status.h",
"tf_tensor.h",
],
visibility = [
@ -78,7 +77,7 @@ tf_cuda_library(
"//tensorflow/core:op_gen_lib",
"//tensorflow/core/distributed_runtime:server_lib",
],
}),
}) + [":tf_status_internal"],
)
cc_library(
@ -102,6 +101,7 @@ tf_cuda_library(
":c_api_no_xla",
":c_api_internal",
":tf_attrtype",
":tf_status_internal",
] + select({
"//tensorflow:with_xla_support": [
"//tensorflow/compiler/tf2xla:xla_compiler",
@ -126,6 +126,7 @@ tf_cuda_library(
":c_api_internal",
":tf_attrtype",
":tf_datatype",
":tf_status_internal",
] + select({
"//tensorflow:android": [
"//tensorflow/core:android_tensorflow_lib_lite",
@ -153,6 +154,22 @@ tf_cuda_library(
}),
)
tf_cuda_library(
name = "tf_status_internal",
hdrs = [
"tf_status.h",
"tf_status_internal.h",
],
deps = select({
"//tensorflow:android": [
"//tensorflow/core:android_tensorflow_lib_lite",
],
"//conditions:default": [
"//tensorflow/core:lib",
],
}),
)
cc_library(
name = "tf_status",
srcs = ["tf_status.cc"],
@ -163,7 +180,7 @@ cc_library(
"//tensorflow/core:android_tensorflow_lib_lite",
],
"//conditions:default": [
"//tensorflow/c:c_api_internal",
":tf_status_internal",
"//tensorflow/core:lib",
],
}),
@ -246,8 +263,8 @@ tf_cuda_library(
hdrs = ["tf_status_helper.h"],
visibility = ["//visibility:public"],
deps = [
":c_api_internal",
":c_api_no_xla",
":tf_status_internal",
"//tensorflow/core:lib",
],
)

View File

@ -35,6 +35,7 @@ limitations under the License.
#include "tensorflow/core/framework/op_gen_lib.h"
#endif // !defined(IS_MOBILE_PLATFORM) && !defined(IS_SLIM_BUILD)
#include "tensorflow/c/c_api_internal.h"
#include "tensorflow/c/tf_status_internal.h"
#include "tensorflow/c/tf_tensor.h"
#include "tensorflow/core/common_runtime/device_mgr.h"
#include "tensorflow/core/common_runtime/eval_const_tensor.h"

View File

@ -29,6 +29,7 @@ limitations under the License.
#include "tensorflow/core/platform/platform.h"
// clang-format on
#include "tensorflow/c/tf_status_internal.h"
#if !defined(IS_MOBILE_PLATFORM) && !defined(IS_SLIM_BUILD)
#include "tensorflow/core/framework/op_gen_lib.h"
#endif // !defined(IS_MOBILE_PLATFORM) && !defined(IS_SLIM_BUILD)
@ -52,10 +53,6 @@ class ServerInterface;
// Internal structures used by the C API. These are likely to change and should
// not be depended on.
struct TF_Status {
tensorflow::Status status;
};
struct TF_Tensor {
~TF_Tensor();

View File

@ -15,7 +15,7 @@ limitations under the License.
#include "tensorflow/c/tf_status.h"
#include "tensorflow/c/c_api_internal.h"
#include "tensorflow/c/tf_status_internal.h"
#include "tensorflow/core/lib/core/status.h"
using ::tensorflow::Status;

View File

@ -14,7 +14,8 @@ limitations under the License.
==============================================================================*/
#include "tensorflow/c/tf_status_helper.h"
#include "tensorflow/c/c_api_internal.h"
#include "tensorflow/c/tf_status_internal.h"
namespace tensorflow {

View File

@ -16,7 +16,7 @@ limitations under the License.
#ifndef TENSORFLOW_C_TF_STATUS_HELPER_H_
#define TENSORFLOW_C_TF_STATUS_HELPER_H_
#include "tensorflow/c/c_api.h"
#include "tensorflow/c/tf_status.h"
#include "tensorflow/core/lib/core/status.h"
namespace tensorflow {

View File

@ -0,0 +1,28 @@
/* Copyright 2019 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef TENSORFLOW_C_TF_STATUS_INTERNAL_H_
#define TENSORFLOW_C_TF_STATUS_INTERNAL_H_
#include "tensorflow/core/lib/core/status.h"
// Internal structures used by the status C API. These are likely to change
// and should not be depended on.
struct TF_Status {
tensorflow::Status status;
};
#endif // TENSORFLOW_C_TF_STATUS_INTERNAL_H_