[DataLoader] Apply sharding settings in dist when num_workers is 0 (#78967)
ghstack-source-id: 9c53e8c9adb3ac7c80ebf22a476385509b252511
Pull Request resolved: https://github.com/pytorch/pytorch/pull/78950
Co-authored-by: Vitaly Fedyunin <vitaly.fedyunin@gmail.com>