(self)
| 1050 | return iter(ret) |
| 1051 | |
| 1052 | def __len__(self): |
| 1053 | # Can only be called if self.sampler has __len__ implemented |
| 1054 | # We cannot enforce this condition, so we turn off typechecking for the |
| 1055 | # implementation below. |
| 1056 | # Somewhat related: see NOTE [ Lack of Default `__len__` in Python Abstract Base Classes ] |
| 1057 | if self.drop_last: |
| 1058 | return len(self.sampler) // self.batch_size |
| 1059 | else: |
| 1060 | return (len(self.sampler) + self.batch_size - 1) // self.batch_size |
| 1061 | |
| 1062 | class DistributedSequentialSampler(Sampler): |
| 1063 | def __init__(self, dataset, world_size=None, rank=None): |
nothing calls this directly
no outgoing calls
no test coverage detected