I have the following code. I don’t know why it’s giving this error.
# 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 inpu_data.size()[0]
    
    def __getitem__(self, idx): 
        input_frame = input_data[idx*batch_size:(idx+1)*batch_size]
        output_words = output_data[idx*batch_size:(idx+1)*batch_size]
        return input_frame, output_words

# dataloader 
loader = Loader()
dataloader = DataLoader(loader, batch_size=20,shuffle=True)

for idx, sample in enumerate(dataloader):
    print(idx)

RuntimeError: cannot unsqueeze empty tensor