Sorry I was probably not clear.
This is how I create my model.
But when I print my model, it’s a model inside a model, inside a model, inside a model, not a list of layers.
Is there a better way to do that?
def getMultiLayerPerceptron(InputNetworkSize, NbClass, nbHidenLayer,
                                   hidden_dimension_size, activationFunction):
    model = torch.nn.Sequential(
        torch.nn.Linear(InputNetworkSize, hidden_dimension_size),
        activationFunction())
    for i in range(nbHidenLayer - 1):
        model = torch.nn.Sequential(
            model,
            torch.nn.Linear(hidden_dimension_size, hidden_dimension_size),
            activationFunction())

    model = torch.nn.Sequential(
        model, torch.nn.Linear(hidden_dimension_size, NbClass))
    return model

A use torch.nn.Sequential because I don’t understand what should I put in the __init__ and what should I put in the forward function when using a class for a multi-layer fully connected neural network