  tensorflow::EagerContextThreadLocalData* GetData() const {
    auto* result =
        tensorflow::GetEagerContextThreadLocalData(py_eager_context_);
    if (!result) {
      throw py::error_already_set();
    }
    return result;
  }
  tensorflow::EagerContextThreadLocalData* GetData() const {
    auto* result =
        tensorflow::GetEagerContextThreadLocalData(py_eager_context_);
    if (!result) {
      throw py::error_already_set();
    }
    return result;
  }