源代码如下:
import tensorflow as tf
v1=tf.constant([1.0,2.0,3.0,4.0])
v2=tf.constant([4.0,3.0,2.0,1.0])
sess=tf.InteractiveSession()
print tf.select(tf.greater(v1,v2),v1,v2).eval()
sess.close()
在linux终端运行,发下如下报错:
AttributeError:‘module’object has no attribute ‘select’
尝试多种方法都没用,怎么解决这个问题呢?
https://www.tensorflow.org/api_docs/ 确实没有tf.select这个函数啊
可以将tf.select换成tf.where, 可以得到结果,不会报错。