From b763ff9aefa1be5f9627191f8275831451554ef6 Mon Sep 17 00:00:00 2001 From: "zuoxin.xiahou" Date: Mon, 22 Jul 2024 15:44:04 +0800 Subject: [PATCH] fix collate_fn for equal sequence length --- torchrec/dataset.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/torchrec/dataset.py b/torchrec/dataset.py index 517e44e..9e68ba2 100644 --- a/torchrec/dataset.py +++ b/torchrec/dataset.py @@ -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: