MCPcopy Create free account
hub / github.com/FreeformRobotics/OTS / Subset

Class Subset

lib/utils/data/dataset.py:93–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91
92
93class Subset(Dataset):
94 def __init__(self, dataset, indices):
95 self.dataset = dataset
96 self.indices = indices
97
98 def __getitem__(self, idx):
99 return self.dataset[self.indices[idx]]
100
101 def __len__(self):
102 return len(self.indices)
103
104
105def random_split(dataset, lengths):

Callers 1

random_splitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected