Your idea is interesting!
The coordinates you calculate are correct in space. But there is a few problems.

How can you remap corrs obtained from space to values in pointset1?
It does not count occurrences more than once.
About second problem,




 ZhengdiYu:

space[pointset1[:, 0], pointset1[:, 1], pointset1[:, 2]] += 1 


This line will not +1 for duplicate indices. For instance, if you define pointset1 all ones, then only index [1, 1, 1] in space will be 1. But we expect it to be len(pointset1).
Try this test:
pointset1 = torch.tensor([[1, 0, 1],
        [0, 0, 0],
        [1, 0, 0], 
        [1, 0, 0], 
        [0, 1, 1], 
        [0, 1, 1], 
        [0, 1, 0], 
        [1, 1, 1],
        [1, 0, 1],
        [1, 1, 1]])
pointset2 = torch.tensor([[1, 1, 1], [1, 0, 0]])

A way like computing histogram would help but still it is not possible to ocmpute it without for loop.