aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/c/c_test_util.h
diff options
context:
space:
mode:
authorGravatar Mingsheng Hong <hongm@google.com>2018-02-14 13:51:14 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-02-14 13:56:45 -0800
commit21fe8feb34cb4d5b15ce35fc421c7430307facd2 (patch)
tree6a5972f199c40521ddbc2f3ade92df8c4082d574 /tensorflow/c/c_test_util.h
parent620dc3f097d047346943c416823f5e370df9fe4b (diff)
Added C-API based unit tests for GPU and XLA GPU testing.
Also refined the API comment for TF_NewSession(). PiperOrigin-RevId: 185739196
Diffstat (limited to 'tensorflow/c/c_test_util.h')
-rw-r--r--tensorflow/c/c_test_util.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/tensorflow/c/c_test_util.h b/tensorflow/c/c_test_util.h
index 805fafae05..2a70177c72 100644
--- a/tensorflow/c/c_test_util.h
+++ b/tensorflow/c/c_test_util.h
@@ -72,6 +72,11 @@ TF_Operation* Add(TF_Output l, TF_Output r, TF_Graph* graph, TF_Status* s,
TF_Operation* Min(TF_Operation* l, TF_Operation* r, TF_Graph* graph,
TF_Status* s, const char* name = "min");
+// If `op_device` is non-empty, set the created op on that device.
+TF_Operation* MinWithDevice(TF_Operation* l, TF_Operation* r, TF_Graph* graph,
+ const string& op_device, TF_Status* s,
+ const char* name = "min");
+
TF_Operation* Neg(TF_Operation* n, TF_Graph* graph, TF_Status* s,
const char* name = "neg");
@@ -127,6 +132,8 @@ class CSession {
TF_Tensor* output_tensor(int i) { return output_values_[i]; }
+ TF_Session* mutable_session() { return session_; }
+
private:
void DeleteInputValues();
void ResetOutputValues();