简介 tf.where(条件语句, A, B) 条件语句为真返回A,为假返回B 代码 import tensorflow as tf a = tf.constant([1, 2, 3, 4, 99, 6]) b = tf.constant([2, 3, 4, 5, 6, 7]) c = tf.where(tf.greater(a, b), a, b) print(c)