[NFC] Mark ThrowTypeError and ThrowValueError as [[noreturn]]
PiperOrigin-RevId: 329770496 Change-Id: I1ddf9ee0d09fab221df6e168f10fe96e73273a07
This commit is contained in:
parent
b30881b05c
commit
7dfd771df8
@ -55,12 +55,12 @@ inline py::object PyoOrThrow(PyObject* ptr) {
|
||||
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();
|
||||
}
|
||||
|
@ -400,7 +400,6 @@ PYBIND11_MODULE(_pywrap_tfe, m) {
|
||||
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 @@ PYBIND11_MODULE(_pywrap_tfe, m) {
|
||||
absl::StrFormat("Allocator stats not available for device '%s'",
|
||||
matched_device->name())
|
||||
.c_str());
|
||||
LOG(FATAL) << "Unreachable";
|
||||
});
|
||||
|
||||
// XLA Eager Logic
|
||||
|
Loading…
x
Reference in New Issue
Block a user