How does one delete layers in a Neural Network?

I was trying to delete parameters and then set them to something different but I get the following error:

AttributeError: conv0.weight

why is that? Why does pytorch return such an attribute if it doesn’t let you delete it later…?

e.g. code:

    for name,param in params:
        if name in dict_params_place_holder:
            param_original = dict_params_original[name]
            delattr(self.net_place_holder, name)