Considering a hypothetical scenario , where we have 10 input layers, and 5 output layers.

How many weights are there in the neural network?

If this is implemented in pytorch, the answer will be 50. But shouldn’t it be 15 since 10 weights from input layer, and 5 weights from output layer? Please resolve my doubt.

The above is not a 2 layer neural network. In a n layer neural network, ‘n’ corresponds to the number of hidden layers.

Keeping the jargon aside, Each neuron in the input connects to every neuron in the second layer. This means to any of the output neurons you have 10 connections from the input.
As there are 5 outputs, total number of layers = 10 * 5 = 50.