Save a list of tensos into a file

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.

Hi,

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

Thank you very much for your quick response

1 Like