Solved by sarahw in post #2 
              
              
                Nevermind, it’s resolved! You can concatenate across dimensions using more nested list comprehensions, e.g. torch.cat([torch.cat([torch.index_select(d, 1, i).unsqueeze(0) for i in tst]).unsqueeze(0) for d,tst in zip(c,icd_positions)])