MCPcopy Create free account
hub / github.com/CausalLearning/robust-unlearnable-examples / TargetedIndexedDataset

Class TargetedIndexedDataset

generate_tap.py:11–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9
10
11class TargetedIndexedDataset():
12 def __init__(self, dataset, classes):
13 self.dataset = dataset
14 self.classes = classes
15
16 def __getitem__(self, idx):
17 x, y, ii = self.dataset[idx]
18 y += 1
19 if y >= self.classes: y -= self.classes
20
21 return x, y, ii
22
23 def __len__(self):
24 return len(self.dataset)
25
26
27def get_args():

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected