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.clone() function is used to create a copy of a tensor. The tf.clone() function creates a new tensor of the same shape and value of another tensor.
tf.clone( x )
- x: It is the tensor which we want to clone. Its value can be tensor, Array, TypedArray type.
Returns: It returns a Tensor Object.
Example 1: In this example, we are creating a copy of the tensor x and storing it into y.
Example 2: In this example, we cloned the tensor x using x.clone() instead of tf.clone(x).
Example 3: Have a look at the example below.
false false false true true