Tensorflow.js tf.reshape() Function
The tf.reshape() function is used to reshape a given tensor with the specified shape.
Parameters: This function has the following parameters:
- x: It is the input tensor that needs to be shaped.
- shape: We need to pass array of numbers to define the output shape.
Return Value: It returns a tf.Tensor.
Tensor [[10, 15], [16, 24]]
Tensor [[1, 2, 3], [4, 5, 6], [7, 8, 9]] Tensor [[1, 2], [3, 4]] Tensor [[11, 12], [13, 14]]