Solved by scrappedsoda in post #2 
              
              
                Well I found the solution to my hassle. In case anybode else runs into this problem, here is my solution. I replaced the 
zero_tensor[:, module.keep_idxs.to(o_tensor.device), :, :] = o_tensor 
line with the following: 
zero_tensor.index_copy_(1, module.keep_idxs, o_tensor) 
The reason for the failur…