hi,
in the following example, i expect that the number of parameters of  model new_m to be the same as m but it is not the case. IntermediateLayerGetter seems to register only the parameters of the tracked modules r something like that (the number of parameters in the original model is not exactly the same as for the same layers in the new model).
it is a nice way to get the intermediate features (during inference for example) but it will cause issues in optimization if it is used during training. the rest of the parameters ill not be updated.  is there a reason that IntermediateLayerGetter has been done this way? thanks
IntermediateLayerGetter: https://github.com/pytorch/vision/blob/master/torchvision/models/_utils.py#L8 91
import torchvision
m = torchvision.models.resnet18(pretrained=False)
sum([p.numel() for p in m.parameters()])
Out[4]: 11689512
new_m = torchvision.models._utils.IntermediateLayerGetter(m, {'layer1': 
  ...:                                                                   'feat1', 'layer3': 'feat2'})
sum([p.numel() for p in new_m.parameters()])
Out[6]: 2782784
sum([p.numel() for p in m.layer1.parameters()]) + sum([p.numel() for p in 
  ...:                                                        m.layer3.parameters()])
Out[8]: 2247680