x = x.flatten(1)
   x = self.cls(x)
   return x, final_feature_map
```
That looks pretty easy. But there are some downsides here which all stem from the same underlying issue: that is, modifying the source code is not ideal:

It’s not always easy to access and change given the practical considerations of a project.
If we want flexibility (switching feature extraction on or off, or having variations on it), we need to further adapt the source code to support that.
It’s not always just a question of inserting a single line of code. Think about how you would go about getting the feature map from one of the intermediate blocks with the way I’ve written this module.
Overall, we’d rather avoid the overhead of maintaining source code for a model, when we actually don’t need to change anything about how it works.

One can see how this downside can start to get a lot more thorny when dealing with larger, more complicated models, and trying to get at features from within nested submodules.