Python | Tensorflow logical_not() method Last Updated : 10 Dec, 2018 Comments Improve Suggest changes Like Article Like Report Tensorflow is an open-source machine learning library developed by Google. One of its applications is to develop deep neural networks. The module tensorflow.math provides support for many basic logical operations. Function tf.logical_not() [alias tf.math.logical_not or tf.Tensor.__invert__] provides support for the logical NOT function in Tensorflow. It expects the input of bool type. The input type is tensor and if the input contains more than one element, an element-wise logical NOT is computed, $ NOT x $ . Syntax: tf.logical_not(x, name=None) or tf.math.logical_not(x, name=None) or tf.Tensor.__invert__(x, name=None) Parameters: x: A Tensor of type bool. name (optional): The name for the operation. Return type: A Tensor of bool type with the same size as that of x. Code: Python3 # Importing the Tensorflow library import tensorflow as tf # A constant vector of size 4 a = tf.constant([True, False, False, True], dtype = tf.bool) # Applying the NOT function and # storing the result in 'b' b = tf.logical_not(a, name ='logical_not') # Initiating a Tensorflow session with tf.Session() as sess: print('Input type:', a) print('Input a:', sess.run(a)) print('Return type:', b) print('Output:', sess.run(b)) Output: Input type: Tensor("Const:0", shape=(4, ), dtype=bool) Input: [ True False False True] Return type: Tensor("logical_and:0", shape=(4, ), dtype=bool) Output: [ False True True False] Comment More infoAdvertise with us Next Article Python | Tensorflow logical_not() method S sanskar27jain Follow Improve Article Tags : Python AI-ML-DS With Python Practice Tags : python Similar Reads Python | Tensorflow logical_or() method Tensorflow is an open-source machine learning library developed by Google. One of its applications is to develop deep neural networks. The module tensorflow.math provides support for many basic mathematical operations. Function tf.logical_or() [alias tf.math.logical_or] provides support for the logi 2 min read Python | Tensorflow logical_and() method Tensorflow is an open-source machine learning library developed by Google. One of its applications is to develop deep neural networks. The module tensorflow.math provides support for many basic logical operations. Function tf.logical_and() [alias tf.math.logical_and] provides support for the logical 2 min read Python | Tensorflow logical_xor() method Tensorflow is an open-source machine learning library developed by Google. One of its applications is to develop deep neural networks. The module tensorflow.math provides support for many basic logical operations. Function tf.logical_xor() [alias tf.math.logical_xor] provides support for the logical 2 min read 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 abs() method Tensorflow is an open-source machine learning library developed by Google. One of its applications is to develop deep neural networks. The module tensorflow.math provides support for many basic mathematical operations. Function tf.abs() [alias tf.math.abs] provides support for the absolute function 3 min read Python | tensorflow.math.argmin() method TensorFlow is open-source python library designed by Google to develop Machine Learning models  and deep learning  neural networks. argmin() is a method present in tensorflow math module. This method is used to find the minimum value across the axes. Syntax: tensorflow.math.argmin( input,axes,output 2 min read Python - tensorflow.math.is_nan() TensorFlow is open-source Python library designed by Google to develop Machine Learning models and deep learning  neural networks. is_nan() returns true if element is NaN otherwise it returns false. Syntax: tensorflow.math.is_NaN( x, name) Parameters: x: It is a tensor. Allowed dtypes are bfloat16, 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.equal() 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) 2 min read Python - tensorflow.math.floor() TensorFlow is open-source Python library designed by Google to develop Machine Learning models and deep learning neural networks. floor() is used to find the element wise floor value of the input i.e. the largest integer not greater than x Syntax: tensorflow.math.floor( x, name) Parameters:  x: It' 2 min read Like