From ec2403ba4f8943e40fe613f9bd72d9c015397c9d Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Lespiau Date: Tue, 5 Jan 2021 11:54:10 -0800 Subject: [PATCH] Use a handle instead of an object. PiperOrigin-RevId: 350188697 Change-Id: Iaef8cab63d2a3ad626021d409d658fe70f3b29dc --- tensorflow/compiler/xla/python/py_client.cc | 4 ++-- tensorflow/compiler/xla/python/py_client.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tensorflow/compiler/xla/python/py_client.cc b/tensorflow/compiler/xla/python/py_client.cc index 7d384724b7a..98c3f0a2f86 100644 --- a/tensorflow/compiler/xla/python/py_client.cc +++ b/tensorflow/compiler/xla/python/py_client.cc @@ -89,7 +89,7 @@ PyClient::GetDefaultDeviceAssignment1D(int num_replicas) { } StatusOr> PyClient::PjRtBufferFromPyval( - const pybind11::object& argument, PjRtDevice* device, bool force_copy, + pybind11::handle argument, PjRtDevice* device, bool force_copy, PjRtClient::HostBufferSemantics host_buffer_semantics) { if (device == nullptr) { TF_RET_CHECK(!pjrt_client_->local_devices().empty()); @@ -123,7 +123,7 @@ StatusOr> PyClient::PjRtBufferFromPyval( return buffer; } StatusOr> PyClient::BufferFromPyval( - const pybind11::object& argument, PjRtDevice* device, bool force_copy, + pybind11::handle argument, PjRtDevice* device, bool force_copy, PjRtClient::HostBufferSemantics host_buffer_semantics) { TF_ASSIGN_OR_RETURN( std::unique_ptr buffer, diff --git a/tensorflow/compiler/xla/python/py_client.h b/tensorflow/compiler/xla/python/py_client.h index f2690fdf6c4..8bbecaeb1b2 100644 --- a/tensorflow/compiler/xla/python/py_client.h +++ b/tensorflow/compiler/xla/python/py_client.h @@ -124,10 +124,10 @@ class PyClient : public std::enable_shared_from_this { } StatusOr> PjRtBufferFromPyval( - const pybind11::object& argument, PjRtDevice* device, bool force_copy, + pybind11::handle argument, PjRtDevice* device, bool force_copy, PjRtClient::HostBufferSemantics host_buffer_semantics); StatusOr> BufferFromPyval( - const pybind11::object& argument, PjRtDevice* device, bool force_copy, + pybind11::handle argument, PjRtDevice* device, bool force_copy, PjRtClient::HostBufferSemantics host_buffer_semantics); StatusOr> Compile(