Could you try to use a static input (e.g. torch.ones) and compare the outputs again? If they are matching, it would indicate that the data loading and processing might be the root cause. Otherwise the mismatch might be created in the model itself.