Not necessarily.
If you would like to keep the forward method without overriding it, replacing a few layers with nn.Identity layers might be the fastest approach.
However, if you would like to just use a few specific layers, I would recommend to override the class and write your custom model or alternatively reuse these layers in your custom model by passing them to your model.