Generally,
In the constructor, we declare all the layers we want to use.
In the forward function, we define how the model is going to be run, from input to output.

My question is what if calling those predefined/built-in **nn.Modules** directly in `forward()` function? Is this [**Keras function API**](https://keras.io/getting-started/functional-api-guide/) style legal for **Pytorch**? If not, why?

Update: **TestModel** constructed in this way did run successfully, without an alarm. But the training loss will descend slowly compared with the conventional way.

```py
import torch.nn as nn
from cnn import CNN

class TestModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.num_embeddings = 2020
        self.embedding_dim = 51

    def forward(self, input):
        x = nn.Embedding(self.num_embeddings, self.embedding_dim)(input)
        # CNN is a customized class and nn.Module subclassed
        # we will ignore the arguments for its instantiation 
        x = CNN(...)(x)
        x = nn.ReLu()(x)
        x = nn.Dropout(p=0.2)(x)
        return output = x

```