Solved by fangyh in post #2 
              
              
                It works for me. 
import torch
from torch.utils.data.dataset import Dataset
from torch.utils.data import DataLoader

# Generate dummy data
input_data = torch.rand((100, 30, 40))
output_data = torch.rand((100, 20, 10))

# Data loader
class Loader(Dataset):
    def __len__(self):
        return input_…