# tf.contrib.framework.smart_constant_value

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v1.15.0/tensorflow/python/framework/smart_cond.py#L62-L90) |

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

    tf.contrib.framework.smart_constant_value(
        pred
    )

<br />

<br />

<br />

| ## Arguments ||
|---|---|
| `pred` | A scalar, either a Python bool or tensor. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| True or False if `pred` has a constant boolean value, None otherwise. ||

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `TypeError` | If `pred` is not a Tensor or bool. |

<br />