| 576 | } |
| 577 | |
| 578 | xla::StatusOr<xla::ShapedBuffer> XRTTupleAllocation::ToShapedBuffer() { |
| 579 | xla::ShapedBuffer shaped_buffer(on_host_shape(), on_device_shape(), |
| 580 | allocator_->platform(), device_ordinal_); |
| 581 | for (const auto& index_buffer : buffers_) { |
| 582 | if (index_buffer.second == nullptr || |
| 583 | index_buffer.second->allocation().is_null()) { |
| 584 | return errors::InvalidArgument("Literal buffer at index ", |
| 585 | index_buffer.first.ToString(), |
| 586 | " has been released"); |
| 587 | } |
| 588 | shaped_buffer.set_buffer(index_buffer.second->allocation(), |
| 589 | index_buffer.first); |
| 590 | } |
| 591 | return std::move(shaped_buffer); |
| 592 | } |
| 593 | |
| 594 | Status XRTTupleAllocation::AliasBufferFrom(const XRTTupleAllocation& source, |
| 595 | const xla::ShapeIndex& source_index, |
nothing calls this directly
no test coverage detected