tf.equal(x, y, name=None)
Returns the truth value of (x == y) element-wise.
Args:
x
: ATensor
. Must be one of the following types:float32
,float64
,int32
,int64
,complex64
,quint8
,qint8
,qint32
.y
: ATensor
. Must have the same type asx
.name
: A name for the operation (optional).
Returns:
A Tensor
of type bool
.
代码举例:
a = tf.constant([2,3])
b = tf.constant([3,4])
sess.run(tf.equal(a,b))
输出:
array([False, False], dtype=bool)