@albanD I prune like this:
m.weight.data = torch.cat((m.weight.data[:filter[1]], m.weight.data[filter[1]+1:]))

I also prune the biases and dependent input channels in the same manner.
I then lower the out_channels parameter in the pruned layer. After pruning all layers I attempted to set all gradients to None, although i’m still unsure if this works.