MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / Enter

Method Enter

tensorflow/compiler/xla/python/xla.cc:552–570  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

550 : name_(std::move(name)), kwargs_(std::move(kwargs)) {}
551
552 void Enter() {
553 if (IsEnabled()) {
554 std::string name(name_);
555 // TODO(skye): we can use kwargs_.empty() once we upgrade to pybind11 2.4
556 // in workspace.bzl
557 if (kwargs_.size() != 0) {
558 absl::StrAppend(&name, "#");
559 bool first = true;
560 for (const auto& entry : kwargs_) {
561 absl::StrAppend(&name, first ? "" : ",",
562 std::string(py::str(entry.first)), "=",
563 std::string(py::str(entry.second)));
564 first = false;
565 }
566 absl::StrAppend(&name, "#");
567 }
568 traceme_.emplace(std::move(name));
569 }
570 }
571 py::object Exit(const py::object& ex_type, const py::object& ex_value,
572 const py::object& traceback) {
573 traceme_.reset();

Calls 4

IsEnabledFunction · 0.85
StrAppendFunction · 0.50
sizeMethod · 0.45
emplaceMethod · 0.45