Thanks a lot for your detailed response, Miguel.
From your explanation, I get to know that torch.nn module is a real layer which can be added or connected to other layers or network models. However, the functions in torch.nn.functional are just some arithmetical operations , not the layers which have trainable parameters such as weights and bias terms.
As a result, layers with parameters are usually initialized in init to be shared by the whole module, while some connections or simple operations without parameters can be defined in forward to be used in  forward propagation.
As for dropout,  because it does not have trainable weights, so that we can use either the layer form (from torch.nn) or connection form (from torch.nn.functional), is that correct?
By this I mean, if I delete the layer self.conv2_drop layer in init, I should change the forawrd method like this:
    class Net(nn.Module):
        def __init__(self):
            super(Net, self).__init__()
            self.conv1 = nn.Conv2d(1, 10, kernel_size=5)
            self.conv2 = nn.Conv2d(10, 20, kernel_size=5)

            #delete this layer 
            #self.conv2_drop = nn.Dropout2d()

            self.fc1 = nn.Linear(320, 50)
            self.fc2 = nn.Linear(50, 10)

        def forward(self, x):
            x = F.relu(F.max_pool2d(self.conv1(x), 2))

           # replace 
           #x = F.relu(F.max_pool2d(self.conv2_drop(self.conv2(x)), 2))
            x = self.conv2(x)
            x = F.dropout(x, training = self.training)
            x = F.relu(F.max_pool2d(x, 2))
           #Or use 
           #x = F.relu(F.max_pool2d(F.dropout(self.conv2(x)), 2))
         
            x = x.view(-1, 320)
            x = F.relu(self.fc1(x))
            x = F.dropout(x, training=self.training)
            x = self.fc2(x)
            return F.log_softmax(x)

Does the change of dropout layer to connections affect something?