aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/core/kernels/control_flow_ops.h
diff options
context:
space:
mode:
authorGravatar Peter Hawkins <phawkins@google.com>2018-05-31 17:03:07 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-05-31 17:06:19 -0700
commitba6d01807feaeaeb10272c9e55a7002306b63db5 (patch)
tree1e12c08f7a8eae14962e9f0556efb235158613fe /tensorflow/core/kernels/control_flow_ops.h
parent6a6cfbfe4bd79fb0eb21b3d0753d3ddf6ee86ce8 (diff)
[TF:XLA] Preliminary support for tpu.replicate() inside of TF control flow (such as tf.while_loop()).
Register the remaining control-flow operators on XLA devices. PiperOrigin-RevId: 198803131
Diffstat (limited to 'tensorflow/core/kernels/control_flow_ops.h')
-rw-r--r--tensorflow/core/kernels/control_flow_ops.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/tensorflow/core/kernels/control_flow_ops.h b/tensorflow/core/kernels/control_flow_ops.h
index 4838f2e2bf..8edbcc9077 100644
--- a/tensorflow/core/kernels/control_flow_ops.h
+++ b/tensorflow/core/kernels/control_flow_ops.h
@@ -97,6 +97,22 @@ class NextIterationOp : public OpKernel {
TF_DISALLOW_COPY_AND_ASSIGN(NextIterationOp);
};
+// A LoopCond op has one input and one output. The input is a boolean
+// scalar representing the taken branches of the "pivot" Switch that
+// determines loop termination. As a contract, any high-level front-end
+// should always use port '0' of the "pivot" switches for loop exit.
+class LoopCondOp : public OpKernel {
+ public:
+ explicit LoopCondOp(OpKernelConstruction* context);
+ ~LoopCondOp() override;
+
+ void Compute(OpKernelContext* context) override;
+
+ bool IsExpensive() override;
+
+ TF_DISALLOW_COPY_AND_ASSIGN(LoopCondOp);
+};
+
} // namespace tensorflow
#endif // TENSORFLOW_KERNELS_CONTROL_FLOW_OPS_H_