tgt_dataset_root = h5py.File('E:\\ADDA\\pytorch-adda-master-lab\\datasets\\lab\\sandy\\mat\\test_target_domain_sandy.mat','r')
data = tgt_dataset_root['data'].value
label = tgt_dataset_root['label'].value

min_len = min(data.shape[0], label.shape[0])
data = data[:min_len]
label = label[:min_len]

data = torch.from_numpy(data)
label = torch.from_numpy(label)

should work.