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.
tensorflow.math provides support for many basic logical operations. Function
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, .
Syntax: tf.logical_not(x, name=None) or tf.math.logical_not(x, name=None) or tf.Tensor.__invert__(x, name=None)
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.
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]
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course