class LinearText(nn.Module): 
    def __init__(self):
        super(CNNText, self).__init__()
        self.encoder_tit = nn.Embedding(3281, 64)
        self.encoder_con = nn.Embedding(496037, 512)
        
        self.title_fc = nn.Linear(64, 32) # 1 * len(tit) * 32
        self.con_fc = nn.Linear(512, 256) # 1 * len(con) * 256
# t.cat((content_out_3,content_out_4,content_out_5),dim=1)
# input_size = len(tit) + len(con)
        self.fc = nn.Linear(input_size, 9)

    def forward(self, title, content):
        
        logits = self.fc()
        return F.log_softmax(logits)

As the above, if the input_size of Linear Layer is changed with the input.(input_size = len(tit) + len(con)).
Therefore, input_size is dynamic.Each input has a different input_size.
How can I implement it in pytorch?
Can anyone can help me?I am very confused.Thanks.