I think the proper way to have such a functionnality is to subclass torch.utils.data.Sampler with a custom one that samples equiprobably from positive and negative samples. Then, you pass an instance of this custom sampler to the DataLoader as the sampler argument.
In any case, however, you will need to decide if you want to repeat the smaller class (so that you visit every element of the larger class once per epoch) or to trim the larger class (so that you visit every element of the smaller class once per epoch). In the first case, data augmentation is recommended.