def pad_batch(batch):
   """ pad sequences in batch with 0s to obtain sequences of identical length """
   
   seq_len = list(map(len, batch))
   max_len = max(seq_len)
   padded_batch = [seq + [0]*(max_len-len(seq)) for seq in batch]
   return padded_batch, seq_len