Lower level of python TraceMe to 1

PiperOrigin-RevId: 313802412
Change-Id: Ia7d3e0866f13676b6562f3290ca8385a1a37c312
This commit is contained in:
Jose Baiocchi 2020-05-29 10:11:51 -07:00 committed by TensorFlower Gardener
parent 8383415398
commit f36a1a090e
1 changed files with 9 additions and 7 deletions

View File

@ -34,13 +34,15 @@ class TraceMeWrapper {
// pybind11::str and pybind11::kwargs are taken by const reference to avoid // pybind11::str and pybind11::kwargs are taken by const reference to avoid
// python reference-counting overhead. // python reference-counting overhead.
TraceMeWrapper(const pybind11::str& name, const pybind11::kwargs& kwargs) TraceMeWrapper(const pybind11::str& name, const pybind11::kwargs& kwargs)
: traceme_([&]() { : traceme_(
std::string name_and_metadata(name); [&]() {
if (!kwargs.empty()) { std::string name_and_metadata(name);
AppendMetadata(&name_and_metadata, kwargs); if (!kwargs.empty()) {
} AppendMetadata(&name_and_metadata, kwargs);
return name_and_metadata; }
}) {} return name_and_metadata;
},
/*level=*/1) {}
// pybind11::kwargs is taken by const reference to avoid python // pybind11::kwargs is taken by const reference to avoid python
// reference-counting overhead. // reference-counting overhead.