Skip to content

Commit 0c30c74

Browse files
committed
Log time to sort dataset
1 parent dc2bc11 commit 0c30c74

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/data/sorted_dataset.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
import torch
22
from torch.utils.data import Dataset
33

4+
import wandb
5+
from time import time
6+
47

58
def sort_indices(dataset):
9+
start = time()
610
labels = dataset.targets
711
sorted_idx = torch.argsort(torch.tensor(labels))
12+
wandb.log({"time_to_sort_dataset": time() - start})
813
return sorted_idx
914

1015

0 commit comments

Comments
 (0)