Although this doesn’t seem to be the issue but just in case I also did that,
if training:
            self.dataset.train_labels.to('cuda')
            self.dataset.train_data.to('cuda')
if not  training:
            self.dataset.test_data.to('cuda')
            self.dataset.test_labels.to('cuda')

it doesn’t work then too