sample_len = 0
ignored = []
for idx in map(int, indices):
if not _valid_size(src.sizes[idx], dst.sizes[idx], max_positions):
if ignore_invalid_inputs:
ignored.append(idx)
continue
After Change
for idx in map(int, indices):
src_size = src.sizes[idx]
dst_size = dst.sizes[idx] if dst else src_size
if not _valid_size(src_size, dst_size, max_positions):
if ignore_invalid_inputs:
ignored.append(idx)
continue