From 62475005e4888e368e19739f22c193e5ee93b453 Mon Sep 17 00:00:00 2001 From: James Betker Date: Sun, 23 Jan 2022 19:05:32 -0700 Subject: [PATCH] Sort data items in descending order, which I suspect will improve performance because we will hit GC less --- codes/trainer/ExtensibleTrainer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codes/trainer/ExtensibleTrainer.py b/codes/trainer/ExtensibleTrainer.py index b7079941..e12253e5 100644 --- a/codes/trainer/ExtensibleTrainer.py +++ b/codes/trainer/ExtensibleTrainer.py @@ -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