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:
parent
e691be7814
commit
907e1baf6e
@ -58,7 +58,6 @@ tf_cuda_library(
|
|||||||
"c_api.h",
|
"c_api.h",
|
||||||
"c_api_internal.h",
|
"c_api_internal.h",
|
||||||
"tf_datatype.h",
|
"tf_datatype.h",
|
||||||
"tf_status.h",
|
|
||||||
"tf_tensor.h",
|
"tf_tensor.h",
|
||||||
],
|
],
|
||||||
visibility = [
|
visibility = [
|
||||||
@ -78,7 +77,7 @@ tf_cuda_library(
|
|||||||
"//tensorflow/core:op_gen_lib",
|
"//tensorflow/core:op_gen_lib",
|
||||||
"//tensorflow/core/distributed_runtime:server_lib",
|
"//tensorflow/core/distributed_runtime:server_lib",
|
||||||
],
|
],
|
||||||
}),
|
}) + [":tf_status_internal"],
|
||||||
)
|
)
|
||||||
|
|
||||||
cc_library(
|
cc_library(
|
||||||
@ -102,6 +101,7 @@ tf_cuda_library(
|
|||||||
":c_api_no_xla",
|
":c_api_no_xla",
|
||||||
":c_api_internal",
|
":c_api_internal",
|
||||||
":tf_attrtype",
|
":tf_attrtype",
|
||||||
|
":tf_status_internal",
|
||||||
] + select({
|
] + select({
|
||||||
"//tensorflow:with_xla_support": [
|
"//tensorflow:with_xla_support": [
|
||||||
"//tensorflow/compiler/tf2xla:xla_compiler",
|
"//tensorflow/compiler/tf2xla:xla_compiler",
|
||||||
@ -126,6 +126,7 @@ tf_cuda_library(
|
|||||||
":c_api_internal",
|
":c_api_internal",
|
||||||
":tf_attrtype",
|
":tf_attrtype",
|
||||||
":tf_datatype",
|
":tf_datatype",
|
||||||
|
":tf_status_internal",
|
||||||
] + select({
|
] + select({
|
||||||
"//tensorflow:android": [
|
"//tensorflow:android": [
|
||||||
"//tensorflow/core:android_tensorflow_lib_lite",
|
"//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(
|
cc_library(
|
||||||
name = "tf_status",
|
name = "tf_status",
|
||||||
srcs = ["tf_status.cc"],
|
srcs = ["tf_status.cc"],
|
||||||
@ -163,7 +180,7 @@ cc_library(
|
|||||||
"//tensorflow/core:android_tensorflow_lib_lite",
|
"//tensorflow/core:android_tensorflow_lib_lite",
|
||||||
],
|
],
|
||||||
"//conditions:default": [
|
"//conditions:default": [
|
||||||
"//tensorflow/c:c_api_internal",
|
":tf_status_internal",
|
||||||
"//tensorflow/core:lib",
|
"//tensorflow/core:lib",
|
||||||
],
|
],
|
||||||
}),
|
}),
|
||||||
@ -246,8 +263,8 @@ tf_cuda_library(
|
|||||||
hdrs = ["tf_status_helper.h"],
|
hdrs = ["tf_status_helper.h"],
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
deps = [
|
deps = [
|
||||||
":c_api_internal",
|
|
||||||
":c_api_no_xla",
|
":c_api_no_xla",
|
||||||
|
":tf_status_internal",
|
||||||
"//tensorflow/core:lib",
|
"//tensorflow/core:lib",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
@ -35,6 +35,7 @@ limitations under the License.
|
|||||||
#include "tensorflow/core/framework/op_gen_lib.h"
|
#include "tensorflow/core/framework/op_gen_lib.h"
|
||||||
#endif // !defined(IS_MOBILE_PLATFORM) && !defined(IS_SLIM_BUILD)
|
#endif // !defined(IS_MOBILE_PLATFORM) && !defined(IS_SLIM_BUILD)
|
||||||
#include "tensorflow/c/c_api_internal.h"
|
#include "tensorflow/c/c_api_internal.h"
|
||||||
|
#include "tensorflow/c/tf_status_internal.h"
|
||||||
#include "tensorflow/c/tf_tensor.h"
|
#include "tensorflow/c/tf_tensor.h"
|
||||||
#include "tensorflow/core/common_runtime/device_mgr.h"
|
#include "tensorflow/core/common_runtime/device_mgr.h"
|
||||||
#include "tensorflow/core/common_runtime/eval_const_tensor.h"
|
#include "tensorflow/core/common_runtime/eval_const_tensor.h"
|
||||||
|
@ -29,6 +29,7 @@ limitations under the License.
|
|||||||
#include "tensorflow/core/platform/platform.h"
|
#include "tensorflow/core/platform/platform.h"
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
|
#include "tensorflow/c/tf_status_internal.h"
|
||||||
#if !defined(IS_MOBILE_PLATFORM) && !defined(IS_SLIM_BUILD)
|
#if !defined(IS_MOBILE_PLATFORM) && !defined(IS_SLIM_BUILD)
|
||||||
#include "tensorflow/core/framework/op_gen_lib.h"
|
#include "tensorflow/core/framework/op_gen_lib.h"
|
||||||
#endif // !defined(IS_MOBILE_PLATFORM) && !defined(IS_SLIM_BUILD)
|
#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
|
// Internal structures used by the C API. These are likely to change and should
|
||||||
// not be depended on.
|
// not be depended on.
|
||||||
|
|
||||||
struct TF_Status {
|
|
||||||
tensorflow::Status status;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct TF_Tensor {
|
struct TF_Tensor {
|
||||||
~TF_Tensor();
|
~TF_Tensor();
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@ limitations under the License.
|
|||||||
|
|
||||||
#include "tensorflow/c/tf_status.h"
|
#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"
|
#include "tensorflow/core/lib/core/status.h"
|
||||||
|
|
||||||
using ::tensorflow::Status;
|
using ::tensorflow::Status;
|
||||||
|
@ -14,7 +14,8 @@ limitations under the License.
|
|||||||
==============================================================================*/
|
==============================================================================*/
|
||||||
|
|
||||||
#include "tensorflow/c/tf_status_helper.h"
|
#include "tensorflow/c/tf_status_helper.h"
|
||||||
#include "tensorflow/c/c_api_internal.h"
|
|
||||||
|
#include "tensorflow/c/tf_status_internal.h"
|
||||||
|
|
||||||
namespace tensorflow {
|
namespace tensorflow {
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ limitations under the License.
|
|||||||
#ifndef TENSORFLOW_C_TF_STATUS_HELPER_H_
|
#ifndef TENSORFLOW_C_TF_STATUS_HELPER_H_
|
||||||
#define 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"
|
#include "tensorflow/core/lib/core/status.h"
|
||||||
|
|
||||||
namespace tensorflow {
|
namespace tensorflow {
|
||||||
|
28
tensorflow/c/tf_status_internal.h
Normal file
28
tensorflow/c/tf_status_internal.h
Normal 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_
|
Loading…
Reference in New Issue
Block a user