(self, idx)
| 17 | self.input_dim = self.datasets[0].input_dim |
| 18 | |
| 19 | def pull_item(self, idx): |
| 20 | if idx < 0: |
| 21 | if -idx > len(self): |
| 22 | raise ValueError( |
| 23 | "absolute value of index should not exceed dataset length" |
| 24 | ) |
| 25 | idx = len(self) + idx |
| 26 | dataset_idx = bisect.bisect_right(self.cumulative_sizes, idx) |
| 27 | if dataset_idx == 0: |
| 28 | sample_idx = idx |
| 29 | else: |
| 30 | sample_idx = idx - self.cumulative_sizes[dataset_idx - 1] |
| 31 | return self.datasets[dataset_idx].pull_item(sample_idx) |
| 32 | |
| 33 | |
| 34 | class MixConcatDataset(torchConcatDataset): |
nothing calls this directly
no outgoing calls
no test coverage detected