(self,
dataset,
num_replicas=None,
rank=None,
shuffle=True,
round_up=True)
| 16 | class DistributedSampler(_DistributedSampler): |
| 17 | |
| 18 | def __init__(self, |
| 19 | dataset, |
| 20 | num_replicas=None, |
| 21 | rank=None, |
| 22 | shuffle=True, |
| 23 | round_up=True): |
| 24 | super().__init__(dataset, num_replicas=num_replicas, rank=rank) |
| 25 | self.shuffle = shuffle |
| 26 | self.round_up = round_up |
| 27 | if self.round_up: |
| 28 | self.total_size = self.num_samples * self.num_replicas |
| 29 | else: |
| 30 | self.total_size = len(self.dataset) |
| 31 | |
| 32 | def __iter__(self): |
| 33 | # deterministically shuffle based on epoch |
nothing calls this directly
no outgoing calls
no test coverage detected