I was able to fix this by change the size of nn.Linear in self.cl 25 as
self.cl = nn.Linear(self.batch_size*self.hidden_dim,self.num_labels)

and in forward()
out,self.hid = self.lstm(x.view(self.window_length,self.batch_size,self.embed_size),self.hid)
return F.log_softmax(self.cl(out.view(len(x),-1)),dim=1)

I seem to be getting pretty good results with this arrangement, but I want to know – is this correct approach ? and if so why ?