Hi,
I initially was using single batch sequence classification where I pass multiple variable length sequence.
For eg : if a particular data sequence have a sequence of length 10 with 5000 dim it is 10x1x5000, I then use the label for each of the sequence of size 10 ( one label for each sequence ) and as per the LSTM tutorial I model the forward() function as follows -
def __init__(hidden_dim,layers,embed_size,num_labels):
    ...
    ...
    self.lstm = nn.LSTM(input_size= self.embed_sz,hidden_size=self.hidden_dim,num_layers=self.layers)
    self.cl = nn.Linear(self.hidden_dim,self.num_labels)
    self.hid = self.init_hidden()
def init_hidden(self):
    hidden_1 = Variable(torch.zeros(self.layers,self.batch_size,self.hidden_dim))
    return (hidden_1,hidden_1)
def forward(self,x):
    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)

But now I want to try for batches instead of taking entire seuqnce length I limit it to 5 and take a batch size of 2, so now my input is fixed to 5x2x5000 , How do I modify the forward function ? I saw in other examples that they only do self.cl 27(out[-1]), but here I want the lstm to see the entire sequence length per batch and learn.
I guess my label would be of size 5x2 in this case ? I am not sure. Please help.