Tensorflow.js tf.Tensor class .dataSync() Method Last Updated : 22 Apr, 2022 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 JavaScript language and can use ML directly in the browser or in Node.js. The tf.Tensor class .dataSync() method is used to synchronously download the values from the tf.Tensor. Syntax: dataSync() Parameters: It takes no parameters Return Value: It returns DataTypeMap[NumericDataType] Example 1: JavaScript // Importing the tensorflow.js library import * as tf from "@tensorflow/tfjs" console.log(tf.tensor([1, 3, 5, 4, 2]).dataSync()) Output: 1, 3, 5, 4, 2 Example 2: JavaScript // Importing the tensorflow.js library import * as tf from "@tensorflow/tfjs" const a= tf.tensor2d([[0, 1], [2, 3]]) console.log(a.dataSync()) Output: 0, 1, 2, 3 Reference: https://js.tensorflow.org/api/latest/#tf.Tensor.dataSync Comment More infoAdvertise with us Next Article Tensorflow.js tf.Tensor class .dataSync() Method D dheerchanana2002 Follow Improve Article Tags : JavaScript Web Technologies Tensorflow.js TensorFlow.js-Classes TensorFlow.js-Tensor +1 More Similar Reads Tensorflow.js tf.Tensor class .data() Method 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. 1 min read Tensorflow.js tf.Tensor class .clone() Method Tensorflow.js is an open-source library for creating machine learning models in Javascript that allows users to run the models directly in the browser. The tf.clone() is a function defined in the class tf.Tensor. It's used to create a replica of a tensor. Syntax : tf.clone( values ) Parameters: valu 1 min read Tensorflow.js tf.TensorBuffer class .get() Method 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.TensorBuffer class .get() method is used to return the value in the specified buffer for the given location. Syntax: get (...lo 2 min read Tensorflow.js tf.Tensor class .array() Method 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 .ar 1 min read Tensorflow.js tf.Tensor class .print() Method 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.print() function is used to Prints information about the tf.Tensor including its data. Syntax: tf.print(value, verbose) Paramet 2 min read Like