Solved by Haydnspass in post #2 
              
              
                Note that by default (at least in Libtorch 1.1) the dataset will be shuffled. 
You can change that behaviour by specifying a sampler (from torch::data::samplers::[your sampler of choice]. 
To construct a dataloader with a sequential sampler: 
auto data_loader = torch::data::make_data_loader<torch::d…