MCPcopy Create free account
hub / github.com/lingeringlight/START / Subset

Class Subset

data/data_helper.py:21–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19
20
21class Subset(torch.utils.data.Dataset):
22 def __init__(self, dataset, limit):
23 indices = torch.randperm(len(dataset))[:limit]
24 self.dataset = dataset
25 self.indices = indices
26
27 def __getitem__(self, idx):
28 return self.dataset[self.indices[idx]]
29
30 def __len__(self):
31 return len(self.indices)
32
33
34def get_train_dataloader(args, patches):

Callers 2

get_train_dataloaderFunction · 0.85
get_train_datasetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…