Tensorflow.js tf.any() Function Last Updated : 21 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. It also helps the developers to develop ML models in the JavaScript language so that ML directly can be used in the browser or in Node.js. The tf.any() function is mainly used to calculate the logical OR of elements across given dimensions for tf.Tensor. Syntax: tf.all(x, axis, keepDims) Parameters: x: the tensors to input.Axis: The dimension(s) to reduce.keepDims: If true, retains reduced elements with size 1. Return Value: It returns tf.Tensor Example 1: JavaScript // Importing @tensorflow/tfslibrary const tf = require("@tensorflow/tfjs") // Initialization of tensor1d const gfg=tf.tensor1d([-1, -2, -3, -4], 'bool') // Printing the boolean value gfg.any().print(); Output: Tensor true Example 2: JavaScript // Importing @tensorflow/tfslibrary const tf = require("@tensorflow/tfjs") // Initialization of the axis const axis = 1; // Initialization 2d tensor of shape [2,2] const gfg=tf.tensor2d([1, 1, 0, 0], [2, 2], 'bool') gfg.any(axis).print() Output: Tensor [True, False] Reference: https://js.tensorflow.org/api/latest/#any Comment More infoAdvertise with us Next Article Tensorflow.js tf.any() Function D dheerchanana2002 Follow Improve Article Tags : JavaScript Web Technologies Tensorflow.js Similar Reads Tensorflow.js tf.addN() 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.addN() function is used to add a specified list of Tensors element-wise. Each Tensor should be of the same shape and data type. 1 min read Tensorflow.js tf.atan() 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 .atan() function is used to find the atan of the stated tensor input and is done element wise. Syntax : Â tf. 2 min read Tensorflow.js tf.asin() 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 .asin() function is used to find the asin of the stated tensor elementwise. Syntax: Â tf.asin(x) Parameters: 2 min read Tensorflow.js tf.all() 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 Node.js. The tf. al 1 min read Tensorflow.js tf.atan2() 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 .atan2() function is used to find the arctangent of the stated tensor inputs and is done element wise. Moreov 2 min read Like