You can do it this way:
import torch

bs = 8
a = torch.zeros(bs, 1)
print("a size", a.size())
b = torch.ones(bs, 1)

idx = torch.randint(2 * bs, (bs,))

d = torch.cat([a, b])[idx] # [bs, 1]

d is a [bs, 1 ] tensor containing a random sample of both batchs, with possible sample duplicates, which is OK for most statistical applications, it is just a sort of bootstraping.