aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/c/c_api.cc
diff options
context:
space:
mode:
authorGravatar Akshay Modi <nareshmodi@google.com>2018-02-06 13:53:56 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-02-06 13:59:51 -0800
commitee5a6641e3a2db7807a655bef21614e97b82c769 (patch)
treed49c5747f02ecc9126af08468b3d3377beb44795 /tensorflow/c/c_api.cc
parentd55d0d863c4e705846fc61ba3af7569cca509d67 (diff)
Make TFE_Py_FastpathExecute work for all types of ops
MatMul benchmarks: entry { name: "MicroBenchmarks.benchmark_gen_math_ops_matmul_2_by_2_CPU" iters: 30000 wall_time: 11.580435435 extras { key: "examples_per_sec" value { double_value: 86352.538781 } } } entry { name: "MicroBenchmarks.benchmark_tfe_py_fastpath_execute_matmul_2_by_2_CPU" iters: 30000 wall_time: 7.02576637268 extras { key: "examples_per_sec" value { double_value: 142333.227004 } } } PiperOrigin-RevId: 184734289
Diffstat (limited to 'tensorflow/c/c_api.cc')
-rw-r--r--tensorflow/c/c_api.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/tensorflow/c/c_api.cc b/tensorflow/c/c_api.cc
index 3c7f041b39..b10af0f060 100644
--- a/tensorflow/c/c_api.cc
+++ b/tensorflow/c/c_api.cc
@@ -109,6 +109,10 @@ TF_Status* TF_NewStatus() { return new TF_Status; }
void TF_DeleteStatus(TF_Status* s) { delete s; }
void TF_SetStatus(TF_Status* s, TF_Code code, const char* msg) {
+ if (code == TF_OK) {
+ s->status = Status::OK();
+ return;
+ }
s->status = Status(static_cast<Code>(code), tensorflow::StringPiece(msg));
}