If pybind11 is installed on the system its headers are already captured
by @local_config_python//:python_headers, so the system lib only needs
to depend on that.
When installed correctly, includes should be #include "pybind11/...",
the bundled pybind11 is based off the source repo which does not match
the install paths. Use bazels strip_include_prefix to align the bundled
headers correctly.
Signed-off-by: Jason Zaman <jason@perfinion.com>
* Simplifies the Python code by taking advantage of pybind11's greater flexibility in exposing a Pythonic API.
* Pybind11 is also better able to handle features of modern C++. SWIG is incapable of parsing many common C++ idioms in XLA's interface, which forced us to create intermediate wrapper classes with SWIG-friendly APIs that do little other than call other XLA APIs (e.g., ComputationBuilder). In many cases, we can now elide these. In combination with the preceding point, the code becomes significantly shorter and more readable.
* Pybind11's numpy integration makes it easy to construct xla Literals that alias numpy arrays. This reduces the number of copies when transferring a numpy array to, say, a GPU to 1 instead of 2; previously a NumPy<->Literal conversion required a copy.
PiperOrigin-RevId: 241067931