这个目前发现的是和control_flow_ops.Assert连用,可以看下面Assert的实例
大于的显示true,支持broadcast
Return a tensor with the same shape and contents as the input tensor or value
Decode a JPEG-encoded image to a uint8 tensor
Asserts that the given condition is true
# Ensure maximum element of x is smaller or equal to 1 assert_op = tf.Assert(tf.less_equal(tf.reduce_max(x), 1.), [x]) x = tf.with_dependencies([assert_op], x)