Tensorflow.js tf.Tensor class .buffer() Method
The tf.Tensor class.buffer() method is used to return a promise of tf.TensorBuffer that holds the underlying data.
Parameters: It does not accept any parameters.
Return Value: It returns Promise <tf.TensorBuffer>.
Example 1: Creating a 2d tensor.