The easiest way would be to use torchvision.ImageFolder 388. This class uses assigns different classes to your folders.
The DataLoder 55 class wraps the Dataset and provides more functionalities like multi-processed loading, shuffling and batching.
Here is an example how your code might look like:
data_path = 'YOUR_PATH'
train_dataset = torchvision.ImageFolder(
    root=data_path,
    transform=torchvision.transforms.ToTensor()
)
train_loader = DataLoader(
    train_dataset,
    batch_size=64,
    num_workers=1,
    shuffle=True
)

for batch_idx, (data, target) in enumerate(train_loader):
    # your training procedure