(self, path, num_cache=1)
| 6 | |
| 7 | class IndexedDataset: |
| 8 | def __init__(self, path, num_cache=1): |
| 9 | super().__init__() |
| 10 | self.path = path |
| 11 | self.data_file = None |
| 12 | self.data_offsets = np.load(f"{path}.idx", allow_pickle=True).item()['offsets'] |
| 13 | self.data_file = open(f"{path}.data", 'rb', buffering=-1) |
| 14 | self.cache = [] |
| 15 | self.num_cache = num_cache |
| 16 | |
| 17 | def check_index(self, i): |
| 18 | if i < 0 or i >= len(self.data_offsets) - 1: |
nothing calls this directly
no outgoing calls
no test coverage detected