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

Method __init__

data/data_helper.py:22–25  ·  view source on GitHub ↗
(self, dataset, limit)

Source from the content-addressed store, hash-verified

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]]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected