Tensorflow.js tf.logicalNot() Function Last Updated : 10 May, 2021 Comments Improve Suggest changes Like Article Like Report Tensorflow.js is an open-source library developed by Google for running machine learning models and deep learning neural networks in the browser or node environment. The tf.logicalNot() function is used to return a tensor of Boolean values for the result of element-wise NOT operation on the specified tensor of Boolean values. Syntax: tf.logicalNot(a, b)Parameters: This function accepts two parameters which are illustrated below: a: The first input tensor. It should have a Boolean datatype.b: The second input tensor. It must have a Boolean datatype.Return Value: It returns a tensor of Boolean values for the result of element-wise NOT operation on the specified tensor of Boolean values. Example 1: JavaScript // Importing the tensorflow.js library import * as tf from "@tensorflow/tfjs" // Initializing some tensors of boolean values const a = tf.tensor1d([false, true], 'bool'); const b = tf.tensor1d([true, false], 'bool'); // Calling the .logicalNot() function a.logicalNot().print(); b.logicalNot().print(); Output: Tensor [true, false] Tensor [false, true]Example 2: JavaScript // Importing the tensorflow.js library import * as tf from "@tensorflow/tfjs" // Using tensors of boolean values as // the parameters of .logicalNot() function tf.tensor1d([false, false], 'bool').logicalNot().print(); tf.tensor1d([true, true], 'bool').logicalNot().print(); Output: Tensor [true, true] Tensor [false, false]Reference: https://js.tensorflow.org/api/latest/#logicalNot Comment More infoAdvertise with us Next Article Tensorflow.js tf.logicalNot() Function K Kanchan_Ray Follow Improve Article Tags : JavaScript Web Technologies Tensorflow.js Similar Reads Tensorflow.js tf.logicalOr() Function Tensorflow.js is an open-source library developed by Google for running machine learning models and deep learning neural networks in the browser or node environment. The tf.logicalOr() function is used to return a tensor of Boolean values for the result of element-wise OR operation on the two specif 1 min read Tensorflow.js tf.logicalXor() Function Tensorflow.js is an open-source library developed by Google for running machine learning models and deep learning neural networks in the browser or node environment. The tf.logicalXor() function is used to return a tensor of Boolean values for the result of element-wise XOR operation on the two spec 1 min read Tensorflow.js tf.logicalAnd() Function Tensorflow.js is an open-source library developed by Google for running machine learning models and deep learning neural networks in the browser or node environment. The tf.logicalAnd() function is used to return a tensor of Boolean values for the result of element-wise AND operation of two specifie 2 min read Tensorflow.js tf.oneHot() Function Tensorflow.js is an open-source library developed by Google for running machine learning models and deep learning neural networks in the browser or node environment. The tf.oneHot() function is used to create a one-hot tf.Tensor. The locations represented by indices take the value as 1 (default valu 2 min read Tensorflow.js tf.print() Function Tensorflow.js is an open-source library developed by Google for running machine learning models and deep learning neural networks in the browser or node environment. It helps developers to develop ML models in JavaScript, and use ML directly in the browser or in Node.js. The tf.print() function is u 2 min read Like