weight=torch.Tensor(np.array([0.0018,0.01]))
rand_tensor = torch.multinomial(weight, 64, replacement=True)
print(rand_tensor)

Output : tensor([1, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1])
These are the indices returned by the multinomial function.
I have a doubt regarding the working of the sampler. May I know how this can be used to find duplicate images? Sorry if the question is a basic one, I am new to writing code for samplers in PyTorch.