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