Skip to content

Commit

Permalink
Fix error message condition in refcounting corruption detection.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 397209808
Change-Id: Ic99f9a6c5c2afb4e2c2937f3aabc17508333c692
  • Loading branch information
tensorflower-gardener committed Sep 17, 2021
1 parent 3681a01 commit 9bb6320
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tensorflow/core/framework/resource_handle.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ ResourceHandle::~ResourceHandle() {}
void ResourceHandle::AsProto(ResourceHandleProto* proto) const {
// TODO(b/197757028): Register the resource with ResourceManager to enable
// serialization of ref-counting handles.
if (!IsRefCounting()) {
LOG(ERROR) << "A ref-counted ResourceHandle cannot be serialized losslessly"
<< "Deserializing the result is a failure: " << name();
if (IsRefCounting()) {
LOG_FIRST_N(ERROR, 10)
<< "A ref-counting ResourceHandle cannot be serialized losslessly. "
<< "Deserializing the result produces a corrupted handle: " << name();
}
proto->set_device(device());
proto->set_container(container());
Expand Down

0 comments on commit 9bb6320

Please sign in to comment.