Tensorflow.js tf.greater() 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.greater() function is used to return the tensor of Boolean values for the two specified tensor values i.e. it returns true if the value of the first tensor is greater than the second tensor value else returns false. It supports broadcasting. Syntax: tf.greater(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 values of the same data type as of tensor "a". Return Value: It returns the tensor of Boolean values i.e. true if the value of the first tensor is greater than the second tensor value else returns false. Example 1: JavaScript // Importing the tensorflow.js library import * as tf from "@tensorflow/tfjs" // Initializing two different tensors const a = tf.tensor1d([2, 4, 6, 8]); const b = tf.tensor1d([1, 4, 5, 9]); // Calling the .greater() function a.greater(b).print(); Output: Tensor [true, false, true, false] Example 2: JavaScript // Importing the tensorflow library import * as tf from "@tensorflow/tfjs" // Calling the .greater() function with two // Different tensors as its parameters tf.tensor1d([1.5, 2.06, 2, 0.05, 4.5]). greater(tf.tensor1d([1.25, 2.60, 2.0, .5, 4.05])).print(); Output: Tensor [true, false, false, false, true] Reference: https://js.tensorflow.org/api/latest/#greater Comment More infoAdvertise with us Next Article Tensorflow.js tf.greater() Function K Kanchan_Ray Follow Improve Article Tags : JavaScript Web Technologies Tensorflow.js Similar Reads Tensorflow.js tf.gather() Function Tensorflow.js is an open-source library that is developed by Google for running machine learning models as well as deep learning neural networks in the browser or node environment. The .gather() function is used to collect the fragments from the stated tensor x's axis as per the stated indices. Synt 2 min read Tensorflow.js tf.greaterEqual() 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.greaterEqual() function is used to return the tensor of Boolean values for the two specified tensor values i.e. it returns true 2 min read Tensorflow.js tf.gatherND() 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 also helps the developers to develop ML models in JavaScript language and can use ML directly in the browser or in Node.js. The tf. 2 min read Tensorflow.js tf.isFinite() 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 .isFinite() function is used to find the finite elements of the stated tensor input. Syntax : Â tf.isFinite(x 2 min read Tensorflow.js tf.max() 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.max() function is used to calculate the maximum value from the specified Tensor across its dimension. It reduces the given inpu 2 min read Like