Tensorflow.js tf.Tensor class .clone() Method Last Updated : 22 Apr, 2022 Comments Improve Suggest changes Like Article Like Report 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: values: It can be a tensor of values or an array of values Return value: It returns the tensor containing elements the same as of values. Example 1: Input parameter values as a tensor JavaScript // Dynamic loading the "@tensorflow/tfjs" module const tf = require('@tensorflow/tfjs'); //Creating a tensor var values = tf.tensor([1, 2, 3, 4, 5, 6, 7]); // Printing the colne of a tensor tf.clone(values).print() Output : Tensor [1, 2, 3, 4, 5, 6, 7] Example 2: Input parameter values as an array of values JavaScript // Dynamic loading the "@tensorflow/tfjs" module const tf = require('@tensorflow/tfjs'); //Creating a tensor var values = [1, 2, 3, 4, 5, 6, 7]; // Printing the colne of a tensor tf.clone(values).print() Output : Tensor [1, 2, 3, 4, 5, 6, 7] Reference:https://js.tensorflow.org/api/latest/#tf.Tensor.clone Comment More infoAdvertise with us Next Article Tensorflow.js tf.Tensor class .clone() Method M ManikantaBandla Follow Improve Article Tags : JavaScript Web Technologies Tensorflow.js TensorFlow.js-Classes TensorFlow.js-Tensor +1 More Similar Reads Tensorflow.js tf.Tensor class .dispose() Method 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 .dispose() function is used to dispose the stated tf.Tensor from the memory. Syntax: dispose()Parameters: This meth 1 min read 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 .dataSync() 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 .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