The error is raised, if an nn.Module is missing the forward definition either because it was never provided or often because of a typo as seen here:
# missing forward
class MyModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.lin = nn.Linear(1, 1)

x = torch.randn(1, 1)
model = MyModel()    
out = model(x)
> NotImplementedError

# typo
class MyModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.lin = nn.Linear(1, 1)
        
    def forwrad(self, x): # NOTE THE TYPO!!!
        return self.lin(x)

model = MyModel()    
out = model(x)
> NotImplementedError

# works
class MyModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.lin = nn.Linear(1, 1)
        
    def forward(self, x):
        return self.lin(x)
    
model = MyModel()    
out = model(x) # works