# How to create a dataloader with variable-size input

**URL:** <https://discuss.pytorch.org/t/how-to-create-a-dataloader-with-variable-size-input/8278>\
**Category:** vision\
**Created:** [October 3, 2017, 5:14pm UTC](https://discuss.pytorch.org/t/how-to-create-a-dataloader-with-variable-size-input/8278 "2017-10-03T17:14:56Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![smth](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/smth/32/13_2.png) [@smth](https://discuss.pytorch.org/u/smth)\
**Post date:** [October 11, 2017, 6:01am UTC](https://discuss.pytorch.org/t/how-to-create-a-dataloader-with-variable-size-input/8278/2 "2017-10-11T06:01:09Z")

</div>

you need to write a custom collate\_fn and pass it to your data loader. [Questions about Dataloader and Dataset](https://discuss.pytorch.org/t/questions-about-dataloader-and-dataset/806/2?u=smth)

---

_[View the full topic](https://discuss.pytorch.org/t/how-to-create-a-dataloader-with-variable-size-input/8278)._
