Shape of tensor
I came across this piece of code

(x_train, y_train), (x_test, y_test) = mnist.load_data()
print("Shape of x_train: " + str(x_train.shape))
print("Shape of y_train: " + str(y_train.shape))

And found that the output looks like this

(60000, 28, 28)
(60000,)

For the first line of output

So far my understanding, does it means that in 1st dimension it can hold 60k items, then in next dimension, it can hold 28 "array of 60k items"
and finally, in the last dimension, it can hold 28 "array of 28 "array of 60k items""

What I want to clarify is, Is this 60k samples of 28x28 data or something else?

For the second line of output, it seems like its just a 1d array of 60k items. So what does it actually represents? (i know that in x_train it was handwritten numbers and each number represents the intensity of grey in that cell)

Please note I have taken this code from some online example(i don't remember and won't mind if you want your credit to be added to this) and public dataset
tf.keras.datasets.mnist

You are right the first line gives 60K items of 28x28 size data thus (60000, 28, 28).

The y_train are labels of the x_train. Thus they are a one dimensional and 60k in number.

For example: If the first item of the x_train is a handwritten image of 3, then the first item of y_train will be '3' which is the label.
