nB = len(seqs)
nS = max([len(seq) for seq in seqs])
arr: Array3d = self.alloc_f3d(nB, nS, seqs[0].shape[1])
for arr_i, (length, seqs_i) in enumerate(lengths_indices):
arr[arr_i, :length] = self.asarray(seqs[seqs_i])
arr = self.as_contig(arr.transpose((1, 0, 2)))
// Build a lookup table so we can find how big the batch is at point t.
batch_size_at_t_ = numpy.zeros(nS, dtype="i")
After Change
lengths_ = [length for length, i in lengths_indices]
nB = len(seqs)
nS = max([len(seq) for seq in seqs])
arr: Array3d = self.pad(seqs)
// Build a lookup table so we can find how big the batch is at point t.
batch_size_at_t_ = numpy.zeros(nS, dtype="i")
batch_size_at_t_ += 1
i = len(lengths_)