Skip to content

Commit

Permalink
fix collate_fn for equal sequence length
Browse files Browse the repository at this point in the history
  • Loading branch information
xiahouzuoxin committed Jul 22, 2024
1 parent d0238de commit b763ff9
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions torchrec/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,11 +501,6 @@ def collate_fn(batch, list_padding_maxlen=256, list_padding_value=-100):
continue

max_len = max([len(f[col]) for f in features])
min_len = min([len(f[col]) for f in features])
if max_len == min_len:
# already padded
continue

max_len = min([list_padding_maxlen, max_len]) if list_padding_maxlen else max_len
padding_value = list_padding_value
if padding_value is None:
Expand Down

0 comments on commit b763ff9

Please sign in to comment.