'Can choose to either handle or ignore variable length sequences.
Always handle padding in eval.'

def forward(self, x, x_mask):

    if (x_mask.data.sum() == 0):
        return self._forward_unpadded(x, x_mask)
    if (self.padding or (not self.training)):
        return self._forward_padded(x, x_mask)
    return self._forward_unpadded(x, x_mask)
