tf.assert_rank_at_least()

tf.assert_rank_at_least(x, rank, data=None, summarize=None, message=None, name=None) Assert x has rank equal to rank or higher. Example of adding a dependency to an operation: with tf.control_dependencies([tf.assert_rank_at_least(x, 2)]): output = tf.reduce_sum(x) Example of adding dependency to the tensor being checked: x = tf.with_dependencies([tf.assert_rank_at_least(x, 2)], x) Args: x: Numeric Tensor. rank: Scalar Tensor. data: The tensors to print out if the condition is False. Def

tf.assert_rank()

tf.assert_rank(x, rank, data=None, summarize=None, message=None, name=None) Assert x has rank equal to rank. Example of adding a dependency to an operation: with tf.control_dependencies([tf.assert_rank(x, 2)]): output = tf.reduce_sum(x) Example of adding dependency to the tensor being checked: x = tf.with_dependencies([tf.assert_rank(x, 2)], x) Args: x: Numeric Tensor. rank: Scalar integer Tensor. data: The tensors to print out if the condition is False. Defaults to error message and fi

tf.assert_proper_iterable()

tf.assert_proper_iterable(values) Static assert that values is a "proper" iterable. Ops that expect iterables of Tensor can call this to validate input. Useful since Tensor, ndarray, byte/text type are all iterables themselves. Args: values: Object to be checked. Raises: TypeError: If values is not iterable or is one of Tensor, SparseTensor, np.array, tf.compat.bytes_or_text_types.

tf.assert_positive()

tf.assert_positive(x, data=None, summarize=None, message=None, name=None) Assert the condition x > 0 holds element-wise. Example of adding a dependency to an operation: with tf.control_dependencies([tf.assert_positive(x)]): output = tf.reduce_sum(x) Example of adding dependency to the tensor being checked: x = tf.with_dependencies([tf.assert_positive(x)], x) Positive means, for every element x[i] of x, we have x[i] > 0. If x is empty this is trivially satisfied. Args: x: Numeric Ten

tf.assert_non_positive()

tf.assert_non_positive(x, data=None, summarize=None, message=None, name=None) Assert the condition x <= 0 holds element-wise. Example of adding a dependency to an operation: with tf.control_dependencies([tf.assert_non_positive(x)]): output = tf.reduce_sum(x) Example of adding dependency to the tensor being checked: x = tf.with_dependencies([tf.assert_non_positive(x)], x) Non-positive means, for every element x[i] of x, we have x[i] <= 0. If x is empty this is trivially satisfied. Arg

tf.assert_non_negative()

tf.assert_non_negative(x, data=None, summarize=None, message=None, name=None) Assert the condition x >= 0 holds element-wise. Example of adding a dependency to an operation: with tf.control_dependencies([tf.assert_non_negative(x)]): output = tf.reduce_sum(x) Example of adding dependency to the tensor being checked: x = tf.with_dependencies([tf.assert_non_negative(x)], x) Non-negative means, for every element x[i] of x, we have x[i] >= 0. If x is empty this is trivially satisfied. Arg

tf.assert_negative()

tf.assert_negative(x, data=None, summarize=None, message=None, name=None) Assert the condition x < 0 holds element-wise. Example of adding a dependency to an operation: with tf.control_dependencies([tf.assert_negative(x)]): output = tf.reduce_sum(x) Example of adding dependency to the tensor being checked: x = tf.with_dependencies([tf.assert_negative(x)], x) Negative means, for every element x[i] of x, we have x[i] < 0. If x is empty this is trivially satisfied. Args: x: Numeric Ten

tf.assert_less_equal()

tf.assert_less_equal(x, y, data=None, summarize=None, message=None, name=None) Assert the condition x <= y holds element-wise. Example of adding a dependency to an operation: with tf.control_dependencies([tf.assert_less_equal(x, y)]): output = tf.reduce_sum(x) Example of adding dependency to the tensor being checked: x = tf.with_dependencies([tf.assert_less_equal(x, y)], x) This condition holds if for every pair of (possibly broadcast) elements x[i], y[i], we have x[i] <= y[i]. If bo

tf.assert_less()

tf.assert_less(x, y, data=None, summarize=None, message=None, name=None) Assert the condition x < y holds element-wise. Example of adding a dependency to an operation: with tf.control_dependencies([tf.assert_less(x, y)]): output = tf.reduce_sum(x) Example of adding dependency to the tensor being checked: x = tf.with_dependencies([tf.assert_less(x, y)], x) This condition holds if for every pair of (possibly broadcast) elements x[i], y[i], we have x[i] < y[i]. If both x and y are empty

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