You could extract all indices for the desired class (e.g. horses) and create a torch.utils.data.Subset using these indices and the dataset before passing it to the DataLoader.
Alternatively, you could also pass these indices to a RandomSubsetSampler and assign it to the DataLoader.