| 839 | } |
| 840 | |
| 841 | void RaiseFallbackException(const char* message) { |
| 842 | if (fallback_exception_class != nullptr) { |
| 843 | PyErr_SetString(fallback_exception_class, message); |
| 844 | return; |
| 845 | } |
| 846 | |
| 847 | PyErr_SetString( |
| 848 | PyExc_RuntimeError, |
| 849 | tensorflow::strings::StrCat( |
| 850 | "Fallback exception type not set, attempting to fallback due to ", |
| 851 | message) |
| 852 | .data()); |
| 853 | } |
| 854 | |
| 855 | int MaybeRaiseExceptionFromTFStatus(TF_Status* status, PyObject* exception) { |
| 856 | if (TF_GetCode(status) == TF_OK) return 0; |
no test coverage detected