Hi, I would like to ask. If I define some layers in the init funtion of a class, but in the forward function, I do not use these layers (not call them), does that affect anything?
For example, take the code below:
class Net(nn.Module):

    def __init__(self, input_size, hidden_size, output_size):
        super(Net, self).__init__()
        self.input_layer = nn.Linear(input_size, hidden_size)-
        self.hidden_layer_1 = nn.Linear(hidden_size, hidden_size)
        self.hidden_layer_2 = nn.Linear(hidden_size, hidden_size)     # not used/not called in forward pass
        self.output_layer = nn.Linear(hidden_size, output_size)

    def forward(self, x):
        out = F.relu(self.input_layer(x))
        out = F.relu(self.hidden_layer_1(out))
        out = torch.sigmoid(self.output_layer(out))
        return out