You could pass your torch.Generator manually to the random function.
I’m not sure, if this API will change in the future, as this argument is not documented as far as I know and maybe shouldn’t be exposed in the current implementation.
However, I think this code should work:
gen0 = torch.Generator()
gen1 = torch.Generator()

gen0 = gen0.manual_seed(0)
gen1 = gen1.manual_seed(1)
torch.rand(5, generator=gen0)
torch.rand(5, generator=gen0)
torch.rand(5, generator=gen1)
torch.rand(5, generator=gen1)

gen0 = gen0.manual_seed(0)
gen1 = gen1.manual_seed(1)
torch.rand(5, generator=gen1)
torch.rand(5, generator=gen1)
torch.rand(5, generator=gen0)
torch.rand(5, generator=gen0)