You would need a custom collate function to use variable input shapes:
def my_collate(batch):
    data = [item for item in batch]
    return data

class TS(Dataset):
    
    def __len__(self):
        return 10
    
    def __getitem__(self,idx):
        return {'token':[1]*idx,'in':idx,'text':"hello"}

ds = TS()
dl = DataLoader(ds,batch_size=3,shuffle=False, collate_fn=my_collate)

for dic in dl:
    print(dic)