Sort data items in descending order, which I suspect will improve performance because we will hit GC less

This commit is contained in:
James Betker 2022-01-23 19:05:32 -07:00
parent d18aec793a
commit 62475005e4

View File

@ -185,7 +185,7 @@ class ExtensibleTrainer(BaseModel):
sort_key = opt_get(self.opt, ['train', 'sort_key'], None)
if sort_key is not None:
sort_indices = torch.sort(data[sort_key]).indices
sort_indices = torch.sort(data[sort_key], descending=True).indices
else:
sort_indices = None