diff options
author | 2017-03-15 15:39:36 -0800 | |
---|---|---|
committer | 2017-03-15 16:51:41 -0700 | |
commit | 32589d191387db16d8505a3f9e0dd10ef2ec194b (patch) | |
tree | 2342f895c466a8f28d1be49ca6d40ea511cd4b0a /tensorflow/compiler/xla/service/allocation_tracker.cc | |
parent | 7946a216c8cb9263c8c485143f3ee75ba186e455 (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.cc | 4 |
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)); |