[XLA:Python] Rename PyBuffer::Device to PyBuffer::device and remove xla:: qualifications in attempt to appease buggy compilers.

PiperOrigin-RevId: 314769346
Change-Id: I1a09c27d9a6efd0e9b62d6597ab7296b3cfa66e6
This commit is contained in:
Peter Hawkins 2020-06-04 11:30:46 -07:00 committed by TensorFlower Gardener
parent 3f8294f6f9
commit 4815e7515f
3 changed files with 5 additions and 5 deletions

View File

@ -25,12 +25,12 @@ PyBuffer::PyBuffer(std::shared_ptr<PjRtClient> client,
std::unique_ptr<PjRtBuffer> buffer)
: client_(std::move(client)), buffer_(std::move(buffer)) {}
ClientAndPtr<Device> PyBuffer::Device() const {
ClientAndPtr<Device> PyBuffer::device() const {
return WrapWithClient(client_, buffer_->device());
}
StatusOr<std::unique_ptr<PyBuffer>> PyBuffer::CopyToDevice(
const ClientAndPtr<xla::Device>& dst_device) const {
const ClientAndPtr<Device>& dst_device) const {
CHECK(dst_device.get() != nullptr);
GlobalPyRefManager()->CollectGarbage();
py::gil_scoped_release gil_release;

View File

@ -37,12 +37,12 @@ class PyBuffer {
std::shared_ptr<PjRtClient> client() const { return client_; }
PjRtBuffer* buffer() const { return buffer_.get(); }
ClientAndPtr<Device> Device() const;
ClientAndPtr<Device> device() const;
const std::string& platform_name() const { return buffer_->platform_name(); }
bool is_deleted() const { return buffer_->IsDeleted(); }
StatusOr<std::unique_ptr<PyBuffer>> CopyToDevice(
const ClientAndPtr<xla::Device>& dst_device) const;
const ClientAndPtr<Device>& dst_device) const;
void Delete() { return buffer_->Delete(); }

View File

@ -663,7 +663,7 @@ PYBIND11_MODULE(xla_extension, m) {
})
.def("shape", &PyBuffer::shape)
.def_property_readonly("client", &PyBuffer::client)
.def("device", &PyBuffer::Device)
.def("device", &PyBuffer::device)
.def("platform", &PyBuffer::platform_name)
.def("is_deleted", &PyBuffer::is_deleted)
.def("unsafe_buffer_pointer", &PyBuffer::UnsafeBufferPointer)