W 3 A 1 | X.shape[0] is 2 in first block and 5 in another block. Why?

image

That is just test code to verify the correctness of the layer_sizes function. We are writing general subroutines here, so they should work with any sized data. There is no law that all inputs have to have 2 elements. Please keep that “generality” idea in mind throughout these courses. It’s a mistake to “hard-code” things unless you have no choice and they specifically tell you to do that, as in the way they handle n_h here. We can figure out n_x from the dimensions of the inputs.

Thanks , will keep that in mind.