Skip to content

Commit

Permalink
checking reimplemented
Browse files Browse the repository at this point in the history
  • Loading branch information
stsouko authored and pytorchmergebot committed May 3, 2023
1 parent fc72e22 commit 954fbd6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion torch/utils/data/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ def __getitem__(self, idx):
def __getitems__(self, indices: List[int]) -> List[T_co]:
# add batched sampling support when parent dataset supports it.
# see torch.utils.data._utils.fetch._MapDatasetFetcher
if hasattr(self.dataset, "__getitems__") and self.dataset.__getitems__:
if callable(getattr(self.dataset, "__getitems__", None)):
return self.dataset.__getitems__([self.indices[idx] for idx in indices]) # type: ignore[attr-defined]
else:
return [self.dataset[self.indices[idx]] for idx in indices]
Expand Down

0 comments on commit 954fbd6

Please sign in to comment.