MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / ToShapedBuffer

Method ToShapedBuffer

tensorflow/compiler/xrt/xrt_state.cc:578–592  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

576}
577
578xla::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
594Status XRTTupleAllocation::AliasBufferFrom(const XRTTupleAllocation& source,
595 const xla::ShapeIndex& source_index,

Callers

nothing calls this directly

Calls 6

InvalidArgumentFunction · 0.85
platformMethod · 0.45
is_nullMethod · 0.45
allocationMethod · 0.45
ToStringMethod · 0.45
set_bufferMethod · 0.45

Tested by

no test coverage detected