Tensorflow.js tf.pow() 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.pow() function is used to compute the power of one specified tensor to another. It supports broadcasting. Syntax: tf.power(base, exp). Parameters: This function accepts two parameters which are illustrated below: base: The specified base component element wise for the given tensor.exp: The specified exponent component element wise for the given tensor. Return Value: It returns a tensor for the computed result of power operation. Example 1: JavaScript // Importing the tensorflow.js library import * as tf from "@tensorflow/tfjs" // Initializing Tensor "a" as base and // "b" as exponent values const a = tf.tensor([2]) const b = tf.tensor([3]) // Calling the pow() function over // the above tensor as its parameters a.pow(b).print(); Output: Tensor [8] Example 2: JavaScript // Importing the tensorflow.js library import * as tf from "@tensorflow/tfjs" // Initializing Tensor "a" as base and // "b" as exponent values const a = tf.tensor([[1, 2], [3, 4]]) const b = tf.tensor([2]) // Calling the pow() function over // the above tensor as its parameters a.pow(b).print(); Output: Tensor [[1, 4 ], [9, 16]] Comment More infoAdvertise with us Next Article Tensorflow.js tf.pow() Function K Kanchan_Ray Follow Improve Article Tags : JavaScript Web Technologies Tensorflow.js Similar Reads Tensorflow.js tf.prod() 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.prod() function is used to calculate product of the elements of a specified Tensor across its dimension. It reduces the given i 2 min read Tensorflow.js tf.log() 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 .log() function is used to find the natural logarithm of the stated tensor input i.e. ln(x) and is done eleme 1 min read Tensorflow.js tf.mod() 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.mod() function returns element-wise remainder of division. Operation: floor(x / y) * y + mod(x, y) = x. Note: It supports broad 2 min read Tensorflow.js tf.pad() 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.ones() Function Tensorflow.js is an open-source library for running machine learning models and deep learning neural networks in the browser or node environment. The tf.ones() function is used to create a new tensor where all elements are set to 1. Syntax: tf.ones(shape, dtype, name) Parameters: shape: It takes the 2 min read Like