This approach could also break the model, since the forward pass would still try to call the deleted module:
class MyModel(nn.Module):
    def __init__(self):
        super(MyModel, self).__init__()
        self.fc1 = nn.Linear(1, 1)
        self.relu1 = nn.ReLU()
        self.fc2 = nn.Linear(1, 1)
        
    def forward(self, x):
        x = self.relu1(self.fc1(x))
        x = self.fc2(x)
        return x

model = MyModel()
x = torch.randn(1, 1)
out = model(x)

del model.fc2

out = model(x)
> ModuleAttributeError: 'MyModel' object has no attribute 'fc2'

While this approach might work well to “clean” the state_dict, I would not recommend it if the model should be used further without rewriting the forward method.