Hi Rishav!



 Rishav_Sen:

tensor([[-2.9972, -2.9940, -3.0171,  ...,  6.3018, -2.9989, -3.0200],
        [-2.9972, -2.9940, -3.0171,  ...,  6.3018, -2.9989, -3.0200],
        [-2.9972, -2.9940, -3.0171,  ...,  6.3018, -2.9989, -3.0200],
        ...,



I guess that the next step would be systematic debugging.
I imagine that you compute:
output_from_model = model (input_to_model)

that input_to_model has shape [nBatch, D_in], and that
output_from_model has shape [nBatch, D_out].
First check whether the rows of output_from_model are exactly
identical, or whether they differ a little bit, but agree up to the
five-digit precision that you print them out with.
Next check whether the rows of input_to_model are the same
as one another or different.  If they are the same, that’s your problem.
If the rows of input_to_model differ from one another, then look at
the intermediate results within your model and see at what point the
rows of the intermediate results become the same.  The layer that
first produces identical rows would likely be the source of the problem.
(Also, you didn’t say whether the rows of output_from_model are
identical before you start training your model, or only become
identical after after running some sort of training procedure.)
Can you reproduce this issue by constructing your model, but not
training it, and passing a single randomly generated input_to_model
through the model?  If so, could you post a fully self-contained script
(with no numpy, sklearn, nor Dataloader) that reproduces this
simple version of your issue?
Good luck.
K. Frank