Yes, len() method should return the dataset’s length.
The getitem() return a single datapoint at index idx everytime it’s called. The dataloader will call it multiple times, depending on the provided batch_size.
In the tutorial, they use batch_size = 4. shuffle = True tells it to randomly select the index between 0 and the len()

dataloader = DataLoader(transformed_dataset, batch_size=4,
shuffle=True, num_workers=4)