Solved by albanD in post #2 
              
              
                You want to count how many samples each value is close to? 
You can do 
expanded_values = value.unsqueeze(1).expand(10000, 10)
expanded_samples = samples.unsqueeze(0).expand(10000, 10)
num_matches = torch.isclose(expanded_values, expanded_samples).sum(-1)