I'm doing a TensorFlow tutorial, where they convert an array of the numbers [1,2,3]
to a tensor like this:
const xs = tf.tensor2d([1, 2, 3], [3, 1])
The shape is [3,1]
because there is one row with 3 numbers.
My question is, why would they use a 2D tensor, isn't this just exactly the same as:
const xs = tf.tensor1d([1, 2, 3])