Python - tensorflow.math.equal() Last Updated : 28 Jul, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report TensorFlow is open-source Python library designed by Google to develop Machine Learning models and deep learning neural networks. equal() is used to perform element by equality comparison. It performs argument broadcasting before applying the comparison. Syntax: tensorflow.math.equal( x, y, name) Parameters: x: It can be a tensor or sparse tensor or indexed slices.y: It can be a tensor or sparse tensor or indexed slices.name(optional): It defines the name for the operation. Returns: It returns a bool tensor. Example 1: In this example broadcasting is performed. Python3 # importing the library import tensorflow as tf # Initializing the input tensor a = tf.constant([6, 8, 12, 2], dtype = tf.float64) b = (2) # Printing the input tensor print('a: ', a) print('b: ', b) # Performing equality comparison res = tf.math.equal(x = a, y = b) # Printing the result print('Result: ', res) Output: a: tf.Tensor([ 6. 8. 12. 2.], shape=(4, ), dtype=float64) b: 2 Result: tf.Tensor([False False False True], shape=(4, ), dtype=bool) Example 2: Python3 # importing the library import tensorflow as tf # Initializing the input tensor a = tf.constant([6, 8, 12, 4], dtype = tf.float64) b = tf.constant([2, 8, 12, 7], dtype = tf.float64) # Printing the input tensor print('a: ', a) print('b: ', b) # Performing equality comparison res = tf.math.equal(x = a, y = b) # Printing the result print('Result: ', res) Output: a: tf.Tensor([ 6. 8. 12. 4.], shape=(4, ), dtype=float64) b: tf.Tensor([ 2. 8. 12. 7.], shape=(4, ), dtype=float64) Result: tf.Tensor([False True True False], shape=(4, ), dtype=bool) Comment More infoAdvertise with us Next Article Python - tensorflow.math.equal() A aman neekhara Follow Improve Article Tags : Machine Learning AI-ML-DS With Python Practice Tags : Machine Learning Similar Reads Python - tensorflow.math.not_equal() TensorFlow is open-source Python library designed by Google to develop Machine Learning models and deep learning  neural networks. not_equal() is used to find element wise truth value of x!=y. It supports broadcasting Syntax: tensorflow.math.not_equal( x, y, name) Parameters: x: It is a tensor. All 2 min read Python - tensorflow.math.less_equal() TensorFlow is open-source Python library designed by Google to develop Machine Learning models and deep learning  neural networks. less_equal() is used to find element wise truth value of x<=y. It supports broadcasting Syntax: tensorflow.math.less_equal( x, y, name) Parameters: x: It is a tensor 2 min read Python - tensorflow.math.ceil() TensorFlow is open-source Python library designed by Google to develop Machine Learning models and deep learning  neural networks. ceil() is used to find the element wise ceil value of the input. Syntax: tensorflow.math.ceil( x, name) Parameters: x: It's a tensor and allowed dtype for this tensor a 2 min read Python - tensorflow.math.erf() TensorFlow is open-source Python library designed by Google to develop Machine Learning models and deep learning  neural networks. erf() is used to compute element wise Gauss error function. Syntax: tensorflow.math.erf(  x, name) Parameters: x: It's the input tensor. Allowed dtypes are bfloat16, h 1 min read Python - tensorflow.math.greater_equal() TensorFlow is open-source Python library designed by Google to develop Machine Learning models and deep learning  neural networks. greater_equal() is used to find element wise truth value of x>=y. It supports broadcasting Syntax: tensorflow.math.greater_equal( x, y, name) Parameters: x: It is a 2 min read Like