Can you do print(input_tensor.size()) to see what is the feature size?
Based on the feature size, you can change
self.linear1 = nn.Linear(12, 12) to self.linear1 = nn.Linear(feature_size, 12).
Regarding (2), you can simply do return self.linear3(sigmoid_out2)