Mahdieh:

for batch_idx, (data, target) in enumerate(dataloader):


modify this to:
for batch_idx, sample in enumerate(dataloader):
        data, target = sample['data'].cuda(), sample['target'].cuda() # or something similar