Tensorflow.js tf.rsqrt() 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.rsqrt() function is used to return the reciprocal of square root of the specified tensor's elements. Syntax: tf.rsqrt (x) Parameters: This function accepts a parameter which is illustrated below: x: The specified input tensor. Return Value: It returns the reciprocal of square root of the specified tensor's elements. Example 1: JavaScript // Importing the tensorflow.js library import * as tf from "@tensorflow/tfjs" // Initializing a tensor of some elements const x = tf.tensor1d([2, 3, 4, 5]); // Calling the .rsqrt() function over // the above tensor as its parameter x.rsqrt().print(); Output: Tensor [0.7071068, 0.5773503, 0.5, 0.4472136] Example 2: JavaScript // Importing the tensorflow.js library import * as tf from "@tensorflow/tfjs" // Using a tensor of some elements // as the parameter for the .rsqrt() function tf.tensor1d([0, 1, -2, 1.7, -2.5]).rsqrt().print(); Output: Tensor [Infinity, 1, NaN, 0.766965, NaN] Comment More infoAdvertise with us Next Article Tensorflow.js tf.rsqrt() Function K Kanchan_Ray Follow Improve Article Tags : JavaScript Web Technologies Tensorflow.js Similar Reads Tensorflow.js tf.sqrt() 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.sqrt() function is used to return the square root of the specified tensor's element. Syntax:Â tf.sqrt( x ) Parameters: This fun 1 min read Tensorflow.js tf.square() 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.square() function is used to return the square of the specified tensor's elements. Syntax: tf.square(x) Parameters: This functi 1 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 Tensorflow.js tf.stack() 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.stack() function is u 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