# Save a list of tensos into a file

**URL:** <https://discuss.pytorch.org/t/save-a-list-of-tensos-into-a-file/83523>\
**Category:** Uncategorized\
**Created:** [May 31, 2020, 1:34am UTC](https://discuss.pytorch.org/t/save-a-list-of-tensos-into-a-file/83523 "2020-05-31T01:34:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![navid\_mahmoudian](https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/n/58f4c7/32.png) [@navid\_mahmoudian](https://discuss.pytorch.org/u/navid_mahmoudian)\
**Post date:** [May 31, 2020, 1:34am UTC](https://discuss.pytorch.org/t/save-a-list-of-tensos-into-a-file/83523/1 "2020-05-31T01:34:05Z")

</div>

Suppose that I have a list of tensors (the tensors have different sizes), and I want to save this list into a single file. Is there any way to do this? The tensors are not model parameters and they are just some data.

---

<div class="post-metadata">

**Author:** ![albanD](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/alband/32/215_2.png) [@albanD](https://discuss.pytorch.org/u/albanD)\
**Post date:** [May 31, 2020, 1:36am UTC](https://discuss.pytorch.org/t/save-a-list-of-tensos-into-a-file/83523/2 "2020-05-31T01:36:34Z")

</div>

Hi,

You can just `torch.save()` the whole list. It will create a single file with the list.

---

<div class="post-metadata">

**Author:** ![navid\_mahmoudian](https://discuss.pytorch.org/letter_avatar_proxy/v4/letter/n/58f4c7/32.png) [@navid\_mahmoudian](https://discuss.pytorch.org/u/navid_mahmoudian)\
**Post date:** [May 31, 2020, 1:43am UTC](https://discuss.pytorch.org/t/save-a-list-of-tensos-into-a-file/83523/3 "2020-05-31T01:43:57Z")

</div>

Thank you very much for your quick response
