TensorFlow 1 version View source on GitHub

Assert that x is of integer dtype.

    x, message=None, name=None

If x has a non-integer type, message, as well as the dtype of x are printed, and InvalidArgumentError is raised.

This can always be checked statically, so this method returns nothing.


  • x: A Tensor.
  • 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 not a non-quantized integer type.