Sure, here is a small example:
class MyModel(nn.Module):
    def __init__(self, features):
        super().__init__()
        self.lin1 = nn.Linear(features, features)
        self.lin2 = nn.Linear(features, features)
        
    def forward(self, x):
        x = self.lin1(x)
        x = F.relu(x)
        x = self.lin2(x)
        return x

class MyNewModel(MyModel):
    def __init__(self, features):
        super().__init__(features)
        
    def forward(self, x):
        x = self.lin1(x)
        x = F.gelu(x)
        x = self.lin2(x)
        return x


model = MyModel(features=10)
x = torch.randn(1, 10)
out = model(x)

new_model = MyNewModel(features=10)
out = model(x)