i would like my code to be able to switch easily between using random and sequential sampling with dataloader.
was hoping to do something like the following. based on a user entered parameter (useseq) i can switch from using random to sequential. of course this doesn’t work. there must be a relatively easy way to do this.
can anyone help?
auto dlisrnd = torch::data::make_data_loader<torch::data::samplers::RandomSampler>(std::move(dsis), cunbs);
auto dlisseq = torch::data::make_data_loader<torch::data::samplers::SequentialSampler>(std::move(dsis), cunbs);
auto dlisuse = dlisrnd;
if (useseq) {
dlisuse = dlisseq;
}