What’s a nice way to get all the properties for a given layer type, maybe in an iteratable way?
For example, for an nn.Linear layer, I am reading currently getting them as:
for name, layer in model.named_modules():
    if isinstance(layer, nn.Linear):
        in_features = model._modules[name].in_features
        out_features = model._modules[name].out_features
        weight = model._modules[name].weight
        bias = model._modules[name].bias

Not only am I accessing a protected member of the class but it’s also error prone, since I want to do this for other layer types as well. is there a nice way to get all the layer properties? I am trying to copy all these and set them for my own custom version of each layer!