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.
input_size is dynamic, therefore, the ‘weight’ will be dynamic. Because the size of ‘weight’ is the length of input_size * feature_numbers. Is this feasible in pytorch?
self.weight = nn.Parameter() The size of weight is solid.How it can be dynamic.
even after self.weight = nn.Parameter(...), you can change size of self.weight manually if you want.
But it’s still not clear to me how you are changing the size of self.weight. How is self.weight actually computed? (not the shape, but also the value of the elements?)