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

Fix only pass RunOptions to keras will trigger core #38562

Merged
Merged
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
11 changes: 3 additions & 8 deletions tensorflow/python/client/tf_session_helper.cc
Expand Up @@ -235,18 +235,13 @@ void RunCallableHelper(tensorflow::Session* session, int64_t handle,
}
}

// Allocate a RunMetadata protobuf object to receive the metadata,
// if the caller is expecting any.
std::unique_ptr<RunMetadata> run_metadata_proto;
if (run_metadata != nullptr) {
run_metadata_proto.reset(new RunMetadata);
}
RunMetadata run_metadata_proto;

// Run the callable.
std::vector<Tensor> output_tensors;
Py_BEGIN_ALLOW_THREADS;
s = session->RunCallable(handle, input_tensors, &output_tensors,
run_metadata_proto.get());
&run_metadata_proto);
Py_END_ALLOW_THREADS;

if (!s.ok()) {
Expand All @@ -256,7 +251,7 @@ void RunCallableHelper(tensorflow::Session* session, int64_t handle,

// If requested, serialize the RunMetadata to pass it back to the caller.
if (run_metadata != nullptr) {
s = MessageToBuffer(*run_metadata_proto, run_metadata);
s = MessageToBuffer(run_metadata_proto, run_metadata);
if (!s.ok()) {
Set_TF_Status_from_Status(out_status, s);
return;
Expand Down