The Dataset.__getitem__ method will get a single index by default and will thus load and process a single sample.
The DataLoader will pass batch_size indices one-by-one to the __getitem__ method and create the batch afterwards using its collate_fn.
So inside __getitem__ treat idx as a single scalar which should load a single sample and target.