Jaliyae/samplers (#13870)
authorJaliya Ekanayake <jaliyaek@microsoft.com>
Thu, 29 Nov 2018 15:04:52 +0000 (07:04 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Thu, 29 Nov 2018 15:07:19 +0000 (07:07 -0800)
commit44cb43bcc168a559040beb20b266bc2806d30385
treeda0f768040cfa06e71527110edfc1974dab452e0
parent9e93a026247c5a09c7f71ed3e36a9273c5477c73
Jaliyae/samplers (#13870)

Summary:
Make Samplers optionally accept new size in their reset() method. This helps dataloader or dataset to reset the sampler for an epoch or a chunk of data with different sizes.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/13870

Differential Revision: D13240120

Pulled By: soumith

fbshipit-source-id: 19c53f8be13c0fdcf504f0637b0d3e6009a8e599
test/cpp/api/dataloader.cpp
torch/csrc/api/include/torch/data/samplers/base.h
torch/csrc/api/include/torch/data/samplers/random.h
torch/csrc/api/include/torch/data/samplers/sequential.h
torch/csrc/api/include/torch/data/samplers/stream.h
torch/csrc/api/src/data/samplers/random.cpp
torch/csrc/api/src/data/samplers/sequential.cpp
torch/csrc/api/src/data/samplers/stream.cpp