Tensorflow.js tf.initializers.zeros() Function Last Updated : 25 Jul, 2021 Comments Improve Suggest changes Like Article Like Report 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 tf.initializers.zeros() function is an initializer that is used to produce tensors that are initialized to zero. Syntax: tf.initializers.zeros() Parameters: This method does not accept any parameter. Return Value: It returns zeros. Example 1: JavaScript // Importing the tensorflow.Js library import * as tf from "@tensorflow/tfjs" // Calling tf.initializers.zeros() function const initializer = tf.initializers.zeros(); // Printing output console.log(JSON.stringify(+initializer)); Output: null Example 2: JavaScript // Importing the tensorflow.Js library import * as tf from "@tensorflow/tfjs" // Calling tf.initializers.zeros() function const initializer = tf.initializers.zeros(); // Defining shape and dtype w.r.t initializer const x = initializer.shape = [ [1, 2], [3, 5]]; const y = initializer.dtype = 'int32'; // Printing output console.log(initializer); console.log(JSON.stringify(+initializer)); Output: { "shape": [ [ 1, 2 ], [ 3, 5 ] ], "dtype": "int32" } null Reference: https://js.tensorflow.org/api/latest/#initializers.zeros Comment More infoAdvertise with us Next Article Tensorflow.js tf.initializers.zeros() Function nidhi1352singh Follow Improve Article Tags : JavaScript Web Technologies Tensorflow.js TensorFlow.js-Initializers Similar Reads Tensorflow.js tf.initializers.ones() Function Tensorflow.js is a very well-known machine learning library that used to develop a machine learning model using JavaScript. The main purpose to use this library is to run and deploy a machine learning model directly from the browser or in Node.js. Tensorflow.js is an open-source hardware-accelerated 2 min read Tensorflow.js tf.initializers.identity() 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 Initializer class is the base class of all initializers in Tensorflow.js. The initializers are used to initialize the Tensors with 2 min read Tensorflow.js tf.initializers.heNormal() 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.initializers.truncatedNormal() 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.zeros() 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.zeros() function is used to create a new tensor with all elements set to zero. Syntax: tf.zeros(shape, dataType) Parameters: sh 2 min read Like