aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/python/ops/cond_v2_impl.py
diff options
context:
space:
mode:
Diffstat (limited to 'tensorflow/python/ops/cond_v2_impl.py')
-rw-r--r--tensorflow/python/ops/cond_v2_impl.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/tensorflow/python/ops/cond_v2_impl.py b/tensorflow/python/ops/cond_v2_impl.py
index c9aa4d4889..81d9cba042 100644
--- a/tensorflow/python/ops/cond_v2_impl.py
+++ b/tensorflow/python/ops/cond_v2_impl.py
@@ -52,6 +52,9 @@ _gradients_impl = None
def cond_v2(pred, true_fn, false_fn, name="cond"):
"""Like tf.cond, except emits a single If op."""
+ if isinstance(pred, bool):
+ raise TypeError("pred must not be a Python bool", pred)
+
if not name:
name = "cond"