Case 1:
class _ResGraphConv(nn.Module):
    def __init__(self, adj, input_dim, output_dim, hid_dim, p_dropout):
        super(_ResGraphConv, self).__init__()

        self.gconv1 = _GraphConv(adj, input_dim, output_dim, p_dropout)
        self.gconv2 = _GraphConv(adj, input_dim, output_dim, p_dropout)

    def forward(self, x):
        residual = x
        out = self.gconv1(x)
        out = self.gconv2(out)
        return residual + out

Case 2:
class _ResGraphConv(nn.Module):
    def __init__(self, adj, input_dim, output_dim, hid_dim, p_dropout):
        super(_ResGraphConv, self).__init__()

        self.gconv1 = _GraphConv(adj, input_dim, output_dim, p_dropout)

    def forward(self, x):
        residual = x
        out = self.gconv1(x)
        out = self.gconv1(out)
        return residual + out

As you can see in case 1, I have created 2 layers and calling them from forward. And in case 2, I’m creating only 1 layer as they take same arguments but calling that from forward twice to decrease the number of parameters. Is there any disadvantage of doing case 2?