if is_list and isinstance(subseq, Objects):
subseq = subseq.data
subseqs.append(subseq)
queue.append(tuple(subseqs))
i += batch_size
return queue
After Change
subseqs = []
for sequence in sequences:
if isinstance(sequence, list):
subseq = [sequence[i] for i in idx_batch]
elif isinstance(sequence, tuple):
subseq = tuple(sequence[i] for i in idx_batch) // type: ignore
else:
subseq = sequence[idx_batch] // type: ignore