Fix TF_TensorFromTensor not setting status on success
PiperOrigin-RevId: 225063980
This commit is contained in:
parent
93439a5539
commit
ec6df8e4fb
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user