def forward(self, batch):
    (x, lengths, _) = batch
    xt = x.float().transpose(1, 2)
    (xt, lengths) = self.spec(xt, lengths)
    xt = self.net['convs'](xt)
    lengths = self.modify_lengths(lengths)
    x = xt.transpose(1, (- 1))
    (batch, time) = x.size()[:2]
    x = x.reshape(batch, time, (- 1))
    x_pack = torch.nn.utils.rnn.pack_padded_sequence(x, lengths, batch_first=True)
    (x_pack, hidden) = self.net['recur'](x_pack)
    (x, _) = torch.nn.utils.rnn.pad_packed_sequence(x_pack, batch_first=True)
    x = self._many_to_one(x, lengths)
    x = self.net['dense'](x)
    x = F.log_softmax(x, dim=1)
    return x
def forward(self, batch):
    (x, lengths, _) = batch
    xt = x.float().transpose(1, 2)
    (xt, lengths) = self.spec(xt, lengths)
    xt = self.net['convs'](xt)
    lengths = self.modify_lengths(lengths)
    x = xt.transpose(1, (- 1))
    (batch, time) = x.size()[:2]
    x = x.reshape(batch, time, (- 1))
    x_pack = torch.nn.utils.rnn.pack_padded_sequence(x, lengths, batch_first=True)
    (x_pack, hidden) = self.net['recur'](x_pack)
    (x, _) = torch.nn.utils.rnn.pad_packed_sequence(x_pack, batch_first=True)
    x = self._many_to_one(x, lengths)
    x = self.net['dense'](x)
    x = F.log_softmax(x, dim=1)
    return x