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

Method DeviceMemoryFromTensor

tensorflow/compiler/jit/xla_tensor.cc:34–44  ·  view source on GitHub ↗

static*/

Source from the content-addressed store, hash-verified

32}
33
34/*static*/ se::DeviceMemoryBase XlaTensor::DeviceMemoryFromTensor(
35 const Tensor& tensor) {
36 const XlaTensor* xla_tensor = FromTensor(&tensor);
37 if (xla_tensor) {
38 CHECK(xla_tensor->has_shaped_buffer());
39 return xla_tensor->shaped_buffer().root_buffer();
40 } else {
41 return se::DeviceMemoryBase(const_cast<char*>(tensor.tensor_data().data()),
42 tensor.tensor_data().size());
43 }
44}
45
46Status XlaTensor::AllocateShapedBuffer(DataType dtype,
47 const xla::Shape& on_host_shape,

Callers

nothing calls this directly

Calls 6

has_shaped_bufferMethod · 0.80
tensor_dataMethod · 0.80
DeviceMemoryBaseClass · 0.50
root_bufferMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected