diff --git a/tensorflow/c/eager/c_api.cc b/tensorflow/c/eager/c_api.cc index 75271b6e826..e70539ceefa 100644 --- a/tensorflow/c/eager/c_api.cc +++ b/tensorflow/c/eager/c_api.cc @@ -537,14 +537,7 @@ void TFE_ContextAddFunctionDef(TFE_Context* ctx, } // extern "C" TFE_TensorHandle* TFE_NewTensorHandle(const tensorflow::Tensor& t) { - TF_Status* status = TF_NewStatus(); - TFE_TensorHandle* tensor = TFE_NewTensorHandle(t, status); - if (TF_GetCode(status) != TF_OK) { - TF_DeleteStatus(status); - return nullptr; - } - TF_DeleteStatus(status); - return tensor; + return new TFE_TensorHandle(t, nullptr); } const tensorflow::Tensor* TFE_TensorHandleUnderlyingTensorInHostMemory(