TF 2.0 is out! Get hands-on practice at TF World, Oct 28-31. Use code TF20 for 20% off select passes. Register now

tf.contrib.framework.smart_constant_value

View source on GitHub

Return the bool value for pred, or None if pred had a dynamic value.

tf.contrib.framework.smart_constant_value(pred)

Arguments:

  • pred: A scalar, either a Python bool or tensor.

Returns:

True or False if pred has a constant boolean value, None otherwise.

Raises:

  • TypeError: If pred is not a Tensor or bool.