Python | Tensorflow logical_and() 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_and() [alias tf.math.logical_and] provides support for the logical AND function in Tensorflow. It expects the input of bool type. The input types are tensor and if the tensors contains more than one element, an element-wise logical AND is computed, $x AND y$ . Syntax: tf.logical_and(x, y, name=None) or tf.math.logical_and(x, y, name=None) Parameters: x: A Tensor of type bool. y: 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 or y. Code: Python3 # Importing the Tensorflow library import tensorflow as tf # A constant vector of size 4 a = tf.constant([True, False, True, False], dtype = tf.bool) b = tf.constant([True, False, False, True], dtype = tf.bool) # Applying the AND function and # storing the result in 'c' c = tf.logical_and(a, b, name ='logical_and') # Initiating a Tensorflow session with tf.Session() as sess: print('Input type:', a) print('Input a:', sess.run(a)) print('Input b:', sess.run(b)) print('Return type:', c) print('Output:', sess.run(c)) Output: Input type: Tensor("Const:0", shape=(4, ), dtype=bool) Input a: [ True False True False] Input b: [ True False False True] Return type: Tensor("logical_and:0", shape=(4, ), dtype=bool) Output: [ True False False False] Comment More infoAdvertise with us Next Article Python | Tensorflow logical_and() 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_not() 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_not() [alias tf.math.logical_not or tf.Tensor.__invert__] provides 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.add() method Tensorflow math.add() method returns the a + b of the passes inputs. The operation is done on the representation of a and b. This method belongs to math module. Syntax: tf.math.add(a, b, name=None) Arguments a: This parameter should be a Tensor and also from the one of the following types: bfloat16, 2 min read Python - Tensorflow math.add_n() method Tensorflow math.add_n() method adds the all passed tensors element-wise. The operation is done on the representation of a and b. This method belongs to math module. Syntax: tf.math.add_n(inputs, name=None) Arguments inputs: It specifies a list of tf.Tensor or tf.IndexedSlices objects, and the shape 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.boolean_mask() method TensorFlow is open-source Python library designed by Google to develop Machine Learning models and deep learning  neural networks. boolean_mask() is method used to apply boolean mask to a Tensor. Syntax: tensorflow.boolean_mask(tensor, mask, axis, name) Parameters: tensor: It's a N-dimensional input 2 min read Python - Tensorflow bitwise.bitwise_and() method Tensorflow bitwise.bitwise_and() method performs the bitwise_and operation and return those bits set, that are set(1) in both a and b. The operation is done on the representation of a and b. This method belongs to bitwise module. Syntax: tf.bitwise.bitwise_and( a, b, name=None) Arguments a: This mus 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.floordiv() TensorFlow is open-source Python library designed by Google to develop Machine Learning models and deep learning  neural networks. floordiv() is used to compute element wise division of x by y and rounding of the result towards most negative integer. Syntax: tensorflow.math.floordiv( x, y, name) Pa 2 min read Like