W3cubDocs

/TensorFlow Python

tf.contrib.framework.smart_constant_value

tf.contrib.framework.smart_constant_value(pred)

Defined in tensorflow/python/framework/smart_cond.py.

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

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.

© 2018 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/contrib/framework/smart_constant_value