diff --git a/tensorflow/compiler/xrt/xrt_state.cc b/tensorflow/compiler/xrt/xrt_state.cc index a0daa5c6c23..c2f9a1c62c9 100644 --- a/tensorflow/compiler/xrt/xrt_state.cc +++ b/tensorflow/compiler/xrt/xrt_state.cc @@ -588,7 +588,8 @@ xla::StatusOr XRTTupleAllocation::ToShapedBuffer() { allocator_->platform(), device_ordinal_); for (const auto& index_buffer : buffers_) { if (index_buffer.second == nullptr || - index_buffer.second->allocation().is_null()) { + (index_buffer.second->allocation().is_null() && + index_buffer.second->allocation().size() > 0)) { return errors::InvalidArgument("Literal buffer at index ", index_buffer.first.ToString(), " has been released"); @@ -652,7 +653,8 @@ xla::StatusOr XRTTupleAllocation::ToExecutionInput( xla::ExecutionInput result(on_device_shape()); for (const auto& index_buffer : buffers_) { if (index_buffer.second == nullptr || - index_buffer.second->allocation().is_null()) { + (index_buffer.second->allocation().is_null() && + index_buffer.second->allocation().size() > 0)) { return errors::InvalidArgument("Literal buffer at index ", index_buffer.first.ToString(), " has been released");