tf.math.equal
Defined in generated file: python/ops/gen_math_ops.py
Returns the truth value of (x == y) element-wise.
Aliases:
tf.compat.v1.equal
tf.compat.v1.math.equal
tf.compat.v2.equal
tf.compat.v2.math.equal
tf.equal
tf.math.equal(
x,
y,
name=None
)
NOTE: math.equal
supports broadcasting. More about broadcasting
here
x = tf.constant([2, 4])
y = tf.constant(2)
tf.math.equal(x, y) ==> array([True, False])
x = tf.constant([2, 4])
y = tf.constant([2, 4])
tf.math.equal(x, y) ==> array([True, True])
Args:
x
: ATensor
. Must be one of the following types:bfloat16
,half
,float32
,float64
,uint8
,int8
,int16
,int32
,int64
,complex64
,quint8
,qint8
,qint32
,string
,bool
,complex128
.y
: ATensor
. Must have the same type asx
.name
: A name for the operation (optional).
Returns:
A Tensor
of type bool
.