aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/c/c_api_experimental.cc
diff options
context:
space:
mode:
authorGravatar Asim Shankar <ashankar@google.com>2018-04-10 19:20:58 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-04-10 19:23:32 -0700
commit531e71b799bb8803d7357a501f38bed5c7141921 (patch)
tree32663a173509c9adcd34709269ce07b7a43faab0 /tensorflow/c/c_api_experimental.cc
parentb675450000753ff77e7a39a9ea84a59210781ea7 (diff)
experimental C API: Fix compilation failure in Windows.
The functions added in https://github.com/tensorflow/tensorflow/commit/be917027e37c5e8f21f6ba07f24bdbf072cf6dfd are temporary, and their existence breaks compilation in MSVC because of https://docs.microsoft.com/en-us/cpp/c-language/maximum-string-length and https://docs.microsoft.com/en-us/cpp/error-messages/compiler-errors-1/compiler-error-c2026 So just disabling it in Windows for now. PiperOrigin-RevId: 192391164
Diffstat (limited to 'tensorflow/c/c_api_experimental.cc')
-rw-r--r--tensorflow/c/c_api_experimental.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/tensorflow/c/c_api_experimental.cc b/tensorflow/c/c_api_experimental.cc
index e82a546092..9678ee926f 100644
--- a/tensorflow/c/c_api_experimental.cc
+++ b/tensorflow/c/c_api_experimental.cc
@@ -20,6 +20,7 @@ limitations under the License.
#include "tensorflow/core/graph/graph.h"
#include "tensorflow/core/graph/node_builder.h"
#include "tensorflow/core/lib/strings/strcat.h"
+#include "tensorflow/core/platform/platform.h"
#include "tensorflow/core/protobuf/config.pb.h"
using tensorflow::FunctionDef;
@@ -189,6 +190,12 @@ library {
// be deleted by calling TF_DeleteFunction.
static std::vector<UniqueFuncPtr> CreateImagenetDatasetFunctions(
const char* file_path, std::string* dataset_name, TF_Status* status) {
+#if defined(PLATFORM_WINDOWS)
+ status->status = tensorflow::errors::Unimplemented(
+ "TF_MakeFileBasedIteratorGetNextWithDatasets in the experimental C API "
+ "is not implemented for Windows");
+ return std::vector<UniqueFuncPtr>();
+#else
const char* func_def = R"PREFIX(
library {
function {
@@ -7067,6 +7074,7 @@ library {
DCHECK(found);
};
return CreateFunctionsFromTextProto(func_def, &mutate_proto_func, status);
+#endif
}
// On success, returns a set of TF_Function instances encoding a dataset
@@ -7076,6 +7084,12 @@ library {
static std::vector<UniqueFuncPtr> CreateMNISTDatasetFunctions(
const char* file_path, int batch_size, std::string* dataset_name,
TF_Status* status) {
+#if defined(PLATFORM_WINDOWS)
+ status->status = tensorflow::errors::Unimplemented(
+ "TF_MakeFileBasedIteratorGetNextWithDatasets in the experimental C API "
+ "is not implemented for Windows");
+ return nullptr;
+#else
const char* func_def = R"PREFIX(
library {
function {
@@ -8205,6 +8219,7 @@ library {
DCHECK(found_batch_size);
};
return CreateFunctionsFromTextProto(func_def, &mutate_proto_func, status);
+#endif
}
// Adds the input functions to `graph`. On success, returns the created