Python - Tensorflow bitwise.invert() method Last Updated : 04 Jun, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report Tensorflow bitwise.invert() method performs the invert operation and the result will invert the bits, Like 0 to 1 and 1 to 0. The operation is done on the representation of a. This method belongs to bitwise module. Syntax: tf.bitwise.invert( a, name=None) Arguments a: This must be a Tensor.It should be from the one of the following types: int8, int16, int32, int64, uint8, uint16, uint32, uint64. name: This is optional parameter and this is the name of the operation. Return: It returns a Tensor having the same type as a. Let's see this concept with the help of few examples: Example 1: Python3 import tensorflow as tf # A constant a a = tf.constant(6, dtype = tf.int32) # Applying the invert function # storing the result in 'c' c = tf.bitwise.invert(a) # Initiating a Tensorflow session with tf.Session() as sess: print("Input 1", a) print(sess.run(a)) print("Output: ", c) print(sess.run(c)) Output: Input 1 Tensor("Const_40:0", shape=(), dtype=int32) 6 Output: Tensor("Invert_4:0", shape=(), dtype=int32) -7 Example 2: Python3 import tensorflow as tf # A constant a a = tf.constant([1, 4, 7], dtype = tf.int32) # Applying the invert function # storing the result in 'c' c = tf.bitwise.invert(a) # Initiating a Tensorflow session with tf.Session() as sess: print("Input 1", a) print(sess.run(a)) print("Output: ", c) print(sess.run(c)) Output: Input 1 Tensor("Const_39:0", shape=(3, ), dtype=int32) [1 4 7] Output: Tensor("Invert_3:0", shape=(3, ), dtype=int32) [-2 -5 -8] Comment More infoAdvertise with us Next Article Python - Tensorflow bitwise.bitwise_or() method P PranchalKatiyar Follow Improve Article Tags : Python Tensorflow Python-Tensorflow Practice Tags : python Similar Reads Python - Tensorflow bitwise.bitwise_or() method Tensorflow bitwise.bitwise_or() method performs the bitwise_or operation and return those bits set, that are either set(1) in a or in b or in both. The operation is done on the representation of a and b. This method belongs to bitwise module. Syntax: tf.bitwise.bitwise_or( a, b, name=None) Arguments 2 min read Python - Tensorflow bitwise.left_shift() method Tensorflow bitwise.left_shift() method performs the left_shift operation on input a defined by input b and return the new constant. The operation is done on the representation of a and b. This method belongs to bitwise module. Syntax: tf.bitwise.left_shift( a, b, name=None) Arguments a: This must be 2 min read Python | tensorflow.bitcast() method TensorFlow is open-source python library designed by Google to develop Machine Learning models and deep learning neural networks. bitcast() is method in tensorflow library which is used to bitcast a tensor from one type to another type. It doesn't copy the data. Syntax: tf.bitcast( input, type, name 2 min read Tensorflow bitwise.bitwise_xor() method - Python Tensorflow bitwise.bitwise_xor() method performs the bitwise_xor operation and the result will set those bits, that are different in a and b. The operation is done on the representation of a and b. This method belongs to bitwise module. Syntax: tf.bitwise.bitwise_xor(a, b, name=None) Arguments a: Th 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 asin() 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.asin() [alias tf.math.asin] provides support for the inverse sine fun 2 min read Like