The second approach will reinitialize the nn.Conv2d module in each forward pass, which is probably not the desired behavior.
If you define extractor once and just use it inside feature_extractor, you’ll get the same behavior as in your first example, as long as you pass the parameters of extractor to the optimizer.