I don’t see where you are checking for duplicated indices in the code and think that:
rand_tensor = torch.multinomial(self.weights, self.bs, False, generator=self.generator)
for _ in range((self.num_samples - self.bs) // self.bs):
    rand_tensor = torch.cat([rand_tensor,
                             torch.multinomial(self.weights, self.bs, False, generator=self.generator)])

could sample repeated values.
While torch.multinominal wouldn’t use replacement, you are still passind the same weights, and thus the sampled values might already be in rand_tensor, no?