aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla/service/allocation_tracker.cc
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/compiler/xla/service/allocation_tracker.cc')
-rw-r--r--tensorflow/compiler/xla/service/allocation_tracker.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/tensorflow/compiler/xla/service/allocation_tracker.cc b/tensorflow/compiler/xla/service/allocation_tracker.cc
index 49a621810e..83759a7a0c 100644
--- a/tensorflow/compiler/xla/service/allocation_tracker.cc
+++ b/tensorflow/compiler/xla/service/allocation_tracker.cc
@@ -64,8 +64,9 @@ GlobalDataHandle AllocationTracker::RegisterInternal(
auto& allocation = FindOrDie(handle_to_allocation_, handle);
int ref_count = allocation->ref_count();
CHECK_GT(ref_count, 0);
- VLOG(2) << "ref_count: " << ref_count << " -> " << ref_count + 1;
- allocation->increment_ref_count();
+ VLOG(2) << "ref_count: " << ref_count << " -> " <<
+ (ref_count + initial_ref_count);
+ allocation->increment_ref_count(initial_ref_count);
} else {
handle = next_handle_++;
VLOG(2) << "ref_count: " << initial_ref_count;