Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.8.0-rc0 cherry-pick request: Fix windows build #18432

Merged
merged 2 commits into from
Apr 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions tensorflow/c/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ tf_cuda_library(
"//tensorflow/core:core_cpu",
"//tensorflow/core:framework",
"//tensorflow/core:lib",
"//tensorflow/core:lib_platform",
"//tensorflow/core:protos_all_cc",
],
)
Expand Down
15 changes: 15 additions & 0 deletions tensorflow/c/c_api_experimental.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand All @@ -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 {
Expand Down Expand Up @@ -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
Expand Down