static*/
| 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 | |
| 46 | Status XlaTensor::AllocateShapedBuffer(DataType dtype, |
| 47 | const xla::Shape& on_host_shape, |
nothing calls this directly
no test coverage detected