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

Function Set_TF_Status_from_Status

tensorflow/c/tf_status_helper.cc:22–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20namespace tensorflow {
21
22void Set_TF_Status_from_Status(TF_Status* tf_status, const Status& status) {
23 tensorflow::error::Code code = status.code();
24 const char* message(status.error_message().c_str());
25
26 switch (code) {
27 case tensorflow::error::OK:
28 assert(TF_GetCode(tf_status) == TF_OK);
29 break;
30 case tensorflow::error::CANCELLED:
31 TF_SetStatus(tf_status, TF_CANCELLED, message);
32 break;
33 case tensorflow::error::UNKNOWN:
34 TF_SetStatus(tf_status, TF_UNKNOWN, message);
35 break;
36 case tensorflow::error::INVALID_ARGUMENT:
37 TF_SetStatus(tf_status, TF_INVALID_ARGUMENT, message);
38 break;
39 case tensorflow::error::DEADLINE_EXCEEDED:
40 TF_SetStatus(tf_status, TF_DEADLINE_EXCEEDED, message);
41 break;
42 case tensorflow::error::NOT_FOUND:
43 TF_SetStatus(tf_status, TF_NOT_FOUND, message);
44 break;
45 case tensorflow::error::ALREADY_EXISTS:
46 TF_SetStatus(tf_status, TF_ALREADY_EXISTS, message);
47 break;
48 case tensorflow::error::PERMISSION_DENIED:
49 TF_SetStatus(tf_status, TF_PERMISSION_DENIED, message);
50 break;
51 case tensorflow::error::UNAUTHENTICATED:
52 TF_SetStatus(tf_status, TF_UNAUTHENTICATED, message);
53 break;
54 case tensorflow::error::RESOURCE_EXHAUSTED:
55 TF_SetStatus(tf_status, TF_RESOURCE_EXHAUSTED, message);
56 break;
57 case tensorflow::error::FAILED_PRECONDITION:
58 TF_SetStatus(tf_status, TF_FAILED_PRECONDITION, message);
59 break;
60 case tensorflow::error::ABORTED:
61 TF_SetStatus(tf_status, TF_ABORTED, message);
62 break;
63 case tensorflow::error::OUT_OF_RANGE:
64 TF_SetStatus(tf_status, TF_OUT_OF_RANGE, message);
65 break;
66 case tensorflow::error::UNIMPLEMENTED:
67 TF_SetStatus(tf_status, TF_UNIMPLEMENTED, message);
68 break;
69 case tensorflow::error::INTERNAL:
70 TF_SetStatus(tf_status, TF_INTERNAL, message);
71 break;
72 case tensorflow::error::UNAVAILABLE:
73 TF_SetStatus(tf_status, TF_UNAVAILABLE, message);
74 break;
75 case tensorflow::error::DATA_LOSS:
76 TF_SetStatus(tf_status, TF_DATA_LOSS, message);
77 break;
78 default:
79 assert(0);

Callers 15

TF_Run_wrapper_helperFunction · 0.85
MakeCallableHelperFunction · 0.85
RunCallableHelperFunction · 0.85
RunCppShapeInferenceFunction · 0.85
TFE_TensorHandleToNumpyFunction · 0.85
NewMethod · 0.85
GetNextMethod · 0.85

Calls 3

TF_GetCodeFunction · 0.85
TF_SetStatusFunction · 0.85
codeMethod · 0.45

Tested by 1

TESTFunction · 0.68