Missed TensorFlow Dev Summit? Check out the video playlist. Watch recordings

tf.debugging.is_numeric_tensor

TensorFlow 1 version View source on GitHub

Returns True if the elements of tensor are numbers.

tf.debugging.is_numeric_tensor(
    tensor
)

Specifically, returns True if the dtype of tensor is one of the following:

Returns False if tensor is of a non-numeric type or if tensor is not a tf.Tensor object.