【发布时间】:2019-10-17 01:17:12
【问题描述】:
我需要比较两个数组并得到真或假,而不是元素结果。我的代码是
X = tf.constant([0.05, 0.10], dtype=tf.float32, shape=[1, 2])
y = tf.constant([0.01, 0.99], dtype=tf.float32, shape=[1, 2])
equality = tf.equal(X, y)
打印 [假,假]
我的要求是得到真或假,而不是数组。
【问题讨论】:
标签: python arrays tensorflow compare tensor