From ec6df8e4fb10b25737295bcb49791842eb478400 Mon Sep 17 00:00:00 2001 From: James Ring Date: Tue, 11 Dec 2018 13:47:51 -0800 Subject: [PATCH] Fix TF_TensorFromTensor not setting status on success PiperOrigin-RevId: 225063980 --- tensorflow/c/c_api.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/tensorflow/c/c_api.cc b/tensorflow/c/c_api.cc index 94d18eb8b04..9580215a317 100644 --- a/tensorflow/c/c_api.cc +++ b/tensorflow/c/c_api.cc @@ -488,6 +488,7 @@ static TF_Tensor* EmptyTensor(TF_DataType dtype, const TensorShape& shape) { // Non-static for testing. TF_Tensor* TF_TensorFromTensor(const tensorflow::Tensor& src, TF_Status* status) { + TF_SetStatus(status, TF_OK, ""); if (!src.IsInitialized()) { status->status = FailedPrecondition( "attempt to use a tensor with an uninitialized value");