Tensorflow.js tf.notEqual() Function Last Updated : 12 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.notEqual() function is used to return a tensor of Boolean values i.e. true if the values of first tensor is not equal to the second one else returns false. It supports broadcasting. Syntax: tf.notEqual(a, b) Parameters: This function accepts two parameters which are illustrated below: a: The first input tensor.b: The second input tensor. It should have same data type as "a". Return Value: It returns a tensor of Boolean values i.e. true if the values of first tensor is not equal to the second one else returns false. Example 1: JavaScript // Importing the tensorflow.js library import * as tf from "@tensorflow/tfjs" // Initializing some tensors const a = tf.tensor1d([1, 2, 3, 4]); const b = tf.tensor1d([1, 4, 3, 4]); // Calling the .notEqual() function a.notEqual(b).print(); Output: Tensor [false, true, false, false] Example 2: JavaScript // Importing the tensorflow.js library import * as tf from "@tensorflow/tfjs" // Using tensors of some values as // the parameters of .notEqual() function tf.tensor1d([0.1, 2.06, 2.1, 3.0]).notEqual( tf.tensor1d([.1, 2.6, 2.0, 3])).print(); Output: Tensor [false, true, true, false] Reference: https://js.tensorflow.org/api/latest/#notEqual Comment More infoAdvertise with us Next Article Tensorflow.js tf.notEqual() Function K Kanchan_Ray Follow Improve Article Tags : JavaScript Web Technologies Tensorflow.js Similar Reads Tensorflow.js tf.lessEqual() 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.lessEqual() function is used to return the tensor of Boolean values for the two specified tensor values i.e. it returns true if 2 min read Tensorflow.js tf.tan() Function Tensorflow.js is an open-source library that is being developed by Google for running machine learning models as well as deep learning neural networks in the browser or node environment. The .tan() function is used to find the tangent of the stated tensor input and is done element wise. Syntax: tf.t 2 min read Tensorflow.js tf.neg() Function Tensorflow.js is an open-source library which is being developed by Google for running machine learning models as well as deep learning neural networks in the browser or node environment. The .neg() function is used to calculate -1 * x i.e. input tensor and is done element wise. Syntax: Â tf.neg(x) 1 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.step() 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.step() function is used to return the step of the input tensor's elements i.e. it returns 1 if the element is greater than 0 el 1 min read Like