tf.debugging.assert_integer

View source on GitHub

Assert that x is of integer dtype.

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.

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

© 2020 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/versions/r2.3/api_docs/python/tf/debugging/assert_integer