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

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

See the guide: Asserts and boolean checks

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)


  • 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".


  • TypeError: If x.dtype is anything other than non-quantized integer.


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

Defined in tensorflow/python/ops/