@jpeg729
Thank you very much for your help. Only after looking at the solution one realizes that it is not very hard if one dabbles more.
I guess following will complete the answer to my question since documentation of CrossEntropyLoss has the restriction saying  input has to be a 2D Tensor of size (minibatch, C) for the problem at hand output is 3D Tensor. Unless there is a direct way to do it, rather than writing custom loss function.
class CrossEntropyS2SLoss(nn.Module):
    """docstring for CrossEntropyS2SLoss"""
    def __init__(self, size_average=True):
        super(CrossEntropyS2SLoss, self).__init__()
        self.size_average = size_average

    def forward(self, output, y):
        batch_size = y.size(0)
        loss_func = nn.CrossEntropyLoss(size_average=self.size_average)

        # Loss from one sequence
        loss = loss_func(output[0, :, :].contiguous(), y[0, :, :].contiguous().view(-1)) # output will be batch_size*seq_len*num_classes an y will be batch_size*seq_len*1
        for i in range(1, batch_size):
            loss += loss_func(output[i, :, :].contiguous(), y[i, :, :].contiguous().view(-1)) #

        return loss