Fix TF_TensorFromTensor not setting status on success

PiperOrigin-RevId: 225063980
This commit is contained in:
James Ring 2018-12-11 13:47:51 -08:00 committed by TensorFlower Gardener
parent 93439a5539
commit ec6df8e4fb

View File

@ -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");