MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / equal

Function equal

tensorflow/python/ops/math_ops.py:1280–1306  ·  view source on GitHub ↗

Returns the truth value of (x == y) element-wise. Usage: ```python 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]) ``` **NOTE**: `Equal` suppor

(x, y, name=None)

Source from the content-addressed store, hash-verified

1278@tf_export("math.equal", "equal")
1279@dispatch.add_dispatch_support
1280def equal(x, y, name=None):
1281 """Returns the truth value of (x == y) element-wise.
1282
1283 Usage:
1284
1285 ```python
1286 x = tf.constant([2, 4])
1287 y = tf.constant(2)
1288 tf.math.equal(x, y) ==> array([True, False])
1289
1290 x = tf.constant([2, 4])
1291 y = tf.constant([2, 4])
1292 tf.math.equal(x, y) ==> array([True, True])
1293 ```
1294
1295 **NOTE**: `Equal` supports broadcasting. More about broadcasting [here](
1296 https://docs.scipy.org/doc/numpy-1.13.0/user/basics.broadcasting.html)
1297
1298 Args:
1299 x: A `Tensor` or `SparseTensor` or `IndexedSlices`.
1300 y: A `Tensor` or `SparseTensor` or `IndexedSlices`.
1301 name: A name for the operation (optional).
1302
1303 Returns:
1304 A `Tensor` of type bool with the same size as that of x or y.
1305 """
1306 return gen_math_ops.equal(x, y, name=name)
1307
1308
1309@tf_export("math.not_equal", "not_equal")

Callers 15

IsTrailingDimensionsFunction · 0.50
IsTailOfShapeFunction · 0.50
WrapsSingleOpMethod · 0.50
WrapsSingleOpMethod · 0.50
VerifyFunction · 0.50
MatchesLayoutInShapeMethod · 0.50
operator()Method · 0.50
ContainersEqualFunction · 0.50
HandleTransposeMethod · 0.50
IsRank2TransposeMethod · 0.50
ShapesSameMethod · 0.50

Calls 1

equalMethod · 0.80

Tested by 3

TEST_FFunction · 0.40
TEST_FFunction · 0.40