Solved by Tony-Y in post #2 
              
              
                You should use Tensor.select(0, index) or simple slicing syntax tensor[index]. 
https://pytorch.org/docs/stable/tensors.html#torch.Tensor.select 
Note that the index must be LongTensor. 
def random_indices(self, batch_size=4):
        '''Generate random constellation symbol indices'''
        indice…