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_data.size()[0]
    
    def __getitem__(self, idx): 
        input_frame = input_data[idx]
        output_words = output_data[idx]
        return input_frame, output_words

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

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