aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/c/c_test_util.h
diff options
context:
space:
mode:
authorGravatar Skye Wanderman-Milne <skyewm@google.com>2017-09-07 16:02:20 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2017-09-07 16:06:27 -0700
commit83ba41e0a38d211fcdb5e3b4e212ef296dc96490 (patch)
tree48526ff884ad5ecfa72c85902ad0290c00c0bc1f /tensorflow/c/c_test_util.h
parentbf1c826a7a3dadd2c971d82e811253b0430f590d (diff)
More C++ while loop validation
With this change, we call IsValidOutputTensor() on the returned outputs from the condition and body functions. This will return a bad status if no output or a null output is set, or if an output has a bad index. This also adds unit tests for related error cases to the C and C++ unit tests. They often produce different errors because the C implementation goes through the graph constructor. PiperOrigin-RevId: 167925641
Diffstat (limited to 'tensorflow/c/c_test_util.h')
-rw-r--r--tensorflow/c/c_test_util.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/tensorflow/c/c_test_util.h b/tensorflow/c/c_test_util.h
index a927739d46..91f96b0e5d 100644
--- a/tensorflow/c/c_test_util.h
+++ b/tensorflow/c/c_test_util.h
@@ -42,6 +42,8 @@ TF_Tensor* Int32Tensor(const std::vector<int32_t>& values);
TF_Tensor* Int32Tensor(int32_t v);
+TF_Tensor* DoubleTensor(double v);
+
TF_Operation* Placeholder(TF_Graph* graph, TF_Status* s,
const char* name = "feed");
@@ -51,6 +53,9 @@ TF_Operation* Const(TF_Tensor* t, TF_Graph* graph, TF_Status* s,
TF_Operation* ScalarConst(int32_t v, TF_Graph* graph, TF_Status* s,
const char* name = "scalar");
+TF_Operation* ScalarConst(double v, TF_Graph* graph, TF_Status* s,
+ const char* name = "scalar");
+
TF_Operation* Add(TF_Operation* l, TF_Operation* r, TF_Graph* graph,
TF_Status* s, const char* name = "add");