fixing pretraining bug with cuda version