In the above snap, the weight has only one element even though I (intentionally) modified it’s above cell to have two weights(which is incorrect for a single feature NN though). Not able to grasp what happened. Someone please enlighten me on this.

-1 makes the zeroth axis to have free length, and the 1 makes the first axis to have exactly length one. This essentially makes the training dataset into one that has any number of samples and one feature per sample. If you are not sure what I am talking here, you need to study and experiment what reshape does.

Therefore, by taking away [0], you did NOT modify anything about the weights. You only modified something about the dataset. This → actually proves that you still only had one weight.

Try to rethink this whole thing with what I just told you here in mind.

1.The number of (weight, bias) pairs in a layer correspond to number of units it
contains.
2.But, these weights and biases won’t be instantiated (of course with random numbers) unless the layer gets to work with at least one sample from the training samples.
3. Now, due to cell 6, weights got instantiated. of course, those number of weights equal to the number of units that are present in the layer gets instantiated irrespective of the number of samples the layer got exposed to (but minimum it should get exposed to is one).
4.Now, each sample in the training data gets multiplied to weight in each neuron and bias be added which gives me 6 values in my tensor.(2 training samples*3 units in my layer).

Hey @rmwkwok , just one more validation required from you.
“The number of weights in ‘each unit’ of the layer correspond to the number of features.”
Please validate this with a simple like if it’s correct.
Thanks for the support