tf.assert_integer()

tf.assert_integer(x, message=None, name=None)

Assert that x is of integer dtype.

Example of adding a dependency to an operation:

with tf.control_dependencies([tf.assert_integer(x)]):
  output = tf.reduce_sum(x)

Example of adding dependency to the tensor being checked:

x = tf.with_dependencies([tf.assert_integer(x)], x)
Args:
  • x: Tensor whose basetype is integer and is not quantized.
  • message: A string to prefix to the default message.
  • name: A name for this operation (optional). Defaults to "assert_integer".
Raises:
  • TypeError: If x.dtype is anything other than non-quantized integer.
Returns:

A no_op that does nothing. Type can be determined statically.

doc_TensorFlow
2016-10-14 12:42:44
Comments
Leave a Comment

Please login to continue.