Solved by mailcorahul in post #8 
              
              
                My bad. Wanted to check size of input_tensor. 
In that case, you can change 
self.linear1 = nn.Linear(12, 12)  to  self.linear1 = nn.Linear(20, 12)