But this will not work if the slices are interleaved, e.g. apply activation ReLU to even neurons, sigmoid to odd neurons. I think torch.index_select or torch.gather can be used to extract those indices then and torch.cat can be used to recombine.