For the SubsetRandomSampler you would need to provide indices, so we have to get the balanced indices from WeightedRandomSampler.
One way would be to create the sampler and instead of returning the data we could return the indices and store them somehow. This doesn’t really sound like a good approach, so let’s instead directly get the indices using torch.multinominal.
I assume you have already the sample weights for your dataset.
This line of code will return len(target) balanced indices:
indices = torch.multinomial(weights, num_samples=len(target), replacement=True)

Once you have these indices you can split them and feed to the SubsetRandomSampler.
If you want to split them in a stratified manner, you can use sklearn.model_selection.train_test_split 9 with stratify=target[indices].
As a small side note: WeigthedRandomSampler is of class Sampler and will be fed to a DataLoader.