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

Method __getitem__

utils/data.py:40–51  ·  view source on GitHub ↗
(self, idx)

Source from the content-addressed store, hash-verified

38 self.fitr = fitr
39
40 def __getitem__(self, idx):
41 x, y = self.x[idx], self.y[idx]
42
43 ''' low pass filtering '''
44 if self.fitr is not None:
45 x = self.fitr(x)
46
47 ''' data augmentation '''
48 if self.transform is not None:
49 x = self.transform( Image.fromarray(x) )
50
51 return x, y
52
53 def __len__(self):
54 return len(self.x)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected