Mark sampler and batch_sampler arguments as optional in the DataLoader interface (#27821)
Summary:
Changelog:
- DataLoader argument `sampler` is now of type `Optional[Sampler[int]]`instead of `Sampler[int]`
- DataLoader argument `batch_sampler` is now of type `Optional[Sampler[Sequence[int]]]` instead of `Sampler[Sequence[int]]`
Fixes https://github.com/pytorch/pytorch/issues/27737
Pull Request resolved: https://github.com/pytorch/pytorch/pull/27821
Differential Revision: D17906623
Pulled By: ezyang
fbshipit-source-id: 088cacbb7e9f7988995f40b71adc3e719815f5ad
Author
Michael Steininger