MCPcopy Create free account
hub / github.com/DragonisCV/RAM / __getitem__

Method __getitem__

ram/data/three_task_dataset.py:40–47  ·  view source on GitHub ↗
(self, index)

Source from the content-addressed store, hash-verified

38 random.shuffle(self.sample_ids)
39
40 def __getitem__(self, index):
41 sample_info = self.sample_ids[index]
42 dataset_idx = sample_info['dataset_idx']
43 sample_idx = sample_info['sample_idx']
44
45 sample = self.datasets[dataset_idx][sample_idx]
46 sample['degradation_type'] = torch.tensor(dataset_idx, dtype=torch.long)
47 return sample
48
49 def __len__(self):
50 return len(self.sample_ids)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected