diff options
author | Mingsheng Hong <hongm@google.com> | 2018-08-08 18:00:05 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-08-08 18:06:53 -0700 |
commit | 8453e23a8b65423a4f2bfb2a98a928954771498f (patch) | |
tree | de12dd18c507eea466fb495fc8f58774a74e204a /tensorflow/c/c_test_util.h | |
parent | f2ff7b160794f2fd8ea5bafb1e910f1c14966202 (diff) |
Added forked versions of stateless If and While ops. They should only be used,
when the if then/else body of If or the While body funcs do not have stateful
ops.
The are lowered to the same XLA ops.
One use case is in the S4TF compiler: https://github.com/apple/swift/pull/18509
PiperOrigin-RevId: 207977126
Diffstat (limited to 'tensorflow/c/c_test_util.h')
-rw-r--r-- | tensorflow/c/c_test_util.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tensorflow/c/c_test_util.h b/tensorflow/c/c_test_util.h index 38313d647c..7eeb1ee5e1 100644 --- a/tensorflow/c/c_test_util.h +++ b/tensorflow/c/c_test_util.h @@ -31,6 +31,8 @@ using ::tensorflow::string; typedef std::unique_ptr<TF_Tensor, decltype(&TF_DeleteTensor)> unique_tensor_ptr; +TF_Tensor* BoolTensor(int32_t v); + // Create a tensor with values of type TF_INT8 provided by `values`. TF_Tensor* Int8Tensor(const int64_t* dims, int num_dims, const char* values); @@ -55,6 +57,9 @@ TF_Operation* Placeholder(TF_Graph* graph, TF_Status* s, TF_Operation* Const(TF_Tensor* t, TF_Graph* graph, TF_Status* s, const char* name = "const"); +TF_Operation* ScalarConst(bool v, TF_Graph* graph, TF_Status* s, + const char* name = "scalar"); + TF_Operation* ScalarConst(int32_t v, TF_Graph* graph, TF_Status* s, const char* name = "scalar"); |