Solved by tom in post #5 
              
              
                Sorry for the delay. 
So I used indexing because I can never figure out scatter for more than one dimension, but this is what I had in mind 
import torch
import math
size = 100
coords = torch.randint(0,size, (50,3))
coords[:, 2] %= 30  # lazy trick, won't be uniformly distributed...

t = torch.zeros…