Make Service::TransferToClient not attempt to manipulate the literal when the transfer failed, preventing a crash and allowing the caller to see the reason for the failed transfer.

PiperOrigin-RevId: 169770126
This commit is contained in:
Bjarke Hammersholt Roune 2017-09-22 20:38:54 -07:00 committed by TensorFlower Gardener
parent 8ef722253c
commit 286f57061c

View File

@ -930,9 +930,10 @@ tensorflow::Status Service::TransferToClient(const TransferToClientRequest* arg,
}
Literal literal;
auto status = LiteralFromAllocation(allocation, *literal_shape, &literal);
TF_RETURN_IF_ERROR(
LiteralFromAllocation(allocation, *literal_shape, &literal));
*result->mutable_literal() = literal.ToProto();
return status;
return tensorflow::Status::OK();
}
tensorflow::Status Service::TransferToServer(const TransferToServerRequest* arg,