It’s not about the dataloader but dataset. Dataset is data-agnostic and it just iterates over a list of indices whose length is set at len dataset method.
How do you expect the dataloader to accept larget batch size if it cannot load non existing data? It will throw errors.
Anyway if you artificially enlarge the number that dataset.len returns you will be able to.
If what you wanna do is create a kind of infinite loop you can use built-in itertools’ repeat which allows you to iterate a iterator as many times as you want.
https://docs.python.org/2/library/itertools.html#itertools.repeat 15