[NFC] Mark ThrowTypeError and ThrowValueError as [[noreturn]]
PiperOrigin-RevId: 329770496
Change-Id: I1ddf9ee0d09fab221df6e168f10fe96e73273a07
diff --git a/tensorflow/python/lib/core/pybind11_lib.h b/tensorflow/python/lib/core/pybind11_lib.h
index a0fb45a..e464728 100644
--- a/tensorflow/python/lib/core/pybind11_lib.h
+++ b/tensorflow/python/lib/core/pybind11_lib.h
@@ -55,12 +55,12 @@
return Pyo(ptr);
}
-void ThrowTypeError(const char* error_message) {
+[[noreturn]] void ThrowTypeError(const char* error_message) {
PyErr_SetString(PyExc_TypeError, error_message);
throw pybind11::error_already_set();
}
-void ThrowValueError(const char* error_message) {
+[[noreturn]] void ThrowValueError(const char* error_message) {
PyErr_SetString(PyExc_ValueError, error_message);
throw pybind11::error_already_set();
}
diff --git a/tensorflow/python/tfe_wrapper.cc b/tensorflow/python/tfe_wrapper.cc
index 8a843eb..d2ee9a4 100644
--- a/tensorflow/python/tfe_wrapper.cc
+++ b/tensorflow/python/tfe_wrapper.cc
@@ -400,7 +400,6 @@
absl::StrFormat("No matching devices found for '%s'", device_name)
.c_str());
}
- CHECK(matched_device);
tensorflow::AllocatorAttributes attrs;
tensorflow::Allocator* allocator = matched_device->GetAllocator(attrs);
@@ -414,7 +413,6 @@
absl::StrFormat("Allocator stats not available for device '%s'",
matched_device->name())
.c_str());
- LOG(FATAL) << "Unreachable";
});
// XLA Eager Logic