aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla/service/allocation_tracker.cc
diff options
context:
space:
mode:
authorGravatar A. Unique TensorFlower <gardener@tensorflow.org>2017-03-15 15:39:36 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-03-15 16:51:41 -0700
commit32589d191387db16d8505a3f9e0dd10ef2ec194b (patch)
tree2342f895c466a8f28d1be49ca6d40ea511cd4b0a /tensorflow/compiler/xla/service/allocation_tracker.cc
parent7946a216c8cb9263c8c485143f3ee75ba186e455 (diff)
[XLA] TransferManager states if tuple elements have distinct buffers from tuple itself.
Also, lets the backend allocator specify behavior for 0-sized buffer allocations via StreamExecutorMemoryAllocator. Change: 150260500
Diffstat (limited to 'tensorflow/compiler/xla/service/allocation_tracker.cc')
-rw-r--r--tensorflow/compiler/xla/service/allocation_tracker.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/tensorflow/compiler/xla/service/allocation_tracker.cc b/tensorflow/compiler/xla/service/allocation_tracker.cc
index a123213401..998ca7d21f 100644
--- a/tensorflow/compiler/xla/service/allocation_tracker.cc
+++ b/tensorflow/compiler/xla/service/allocation_tracker.cc
@@ -125,7 +125,9 @@ tensorflow::Status AllocationTracker::DeallocateShape(
handle_map.erase(device_memory->opaque());
}
- if (ShapeUtil::IsTuple(shape)) {
+ // TODO(b/36256956) Ideally tuple elements could always be distinct buffers.
+ if (ShapeUtil::IsTuple(shape) &&
+ backend->transfer_manager()->TupleElementsAreDistinctBuffers()) {
// Traverse into tuple recursively deallocating buffers.
TF_ASSIGN_OR_RETURN(se::StreamExecutor * executor,
backend->stream_executor(device_ordinal));