@Takumi3 An Interesting problem actually  but as @thecho7 mentioned, you cannot run a single command to do index to index mapping of data row and layer object
This is the closes you can do for parallelization
module_list = nn.ModuleList([nn.Linear(10, 1) for i in range(10)])
input_data = torch.FloatTensor(3, 10)
indices = torch.LongTensor([4,7,1])
torch.stack([module_list[module_index](input_data[data_index]) for data_index, module_index in enumerate(indices)])