Peter Hawkins 7df1f4ffc3 [XLA:Python] Add support for collecting Python tracebacks.
Adds a new xla_client.Traceback API that can collect Python tracebacks cheaply (~2us). This is several orders of magnitude cheaper than using the Python `inspect.stack` API.

Add a facility to attach a traceback to every buffer and executable object describing its creation context. To avoid paying a runtime cost when not debugging, tracebacks collection is optional and disabled by default.

PiperOrigin-RevId: 314793876
Change-Id: Ie5f509364065739c1da4d1a8a729c4c6f56e2d03
2020-06-04 13:39:07 -07:00
..