Thanks for reply,
when first example of 1*3 is passed through first hidden layer it works,
below is weight matrix 3 * 10 of first hidden layer:
(Pytorch output):
tensor([[ 0.4778,  0.4947, -0.4435],
[-0.0535,  0.5000,  0.1650],
[-0.5120,  0.5192, -0.0072],
[-0.1666,  0.0537,  0.5399],
[-0.5655, -0.4967,  0.0043],
[ 0.1430,  0.0842, -0.4497],
[-0.1533,  0.2130, -0.4762],
[-0.2144, -0.3397, -0.1646],
[-0.1230, -0.3268,  0.4827],
[-0.4620, -0.3071,  0.3321]], dtype=torch.float64)
when second example of same batch is passed then it throws error of size mismatching.Below is the weight matrix of first hidden layer after updating
tensor([[-1.9652e-05, -5.2278e-04,  5.1098e-05],
[ 6.4976e-06,  1.7285e-04, -1.6894e-05],
[ 3.9244e-06,  1.0440e-04, -1.0204e-05],
[-9.4330e-06, -2.5093e-04,  2.4527e-05],
[ 8.6443e-06,  2.2995e-04, -2.2476e-05],
[ 4.9573e-06,  1.3187e-04, -1.2889e-05],
[-9.0200e-07, -2.3995e-05,  2.3453e-06],
[-9.8638e-06, -2.6239e-04,  2.5647e-05],
[ 8.2014e-06,  2.1817e-04, -2.1324e-05],
[-8.1189e-06, -2.1598e-04,  2.1110e-05]], dtype=torch.float64)
Dimensions are same for the second example also how could it be possible ??