Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any thing like 'TensorList’ in pytorch?

I would like to put some tensor in a list, and I know if I would like to put nn.Module class into a list, I must use ModuleList to wrap that list. So, Is there anything like 'TensorList’ in pytorch, that I must use to wrap the list containing tensors?

like image 511
Wu Shiauthie Avatar asked Oct 15 '25 04:10

Wu Shiauthie


1 Answers

What are these tensors? Are these tensors parameters of your nn.Module? If so, you need to use the proper container.
For example, using nn.ParameterList. This way calling your module's .paramters() methods will yield these tensors as well. Otherwise you'll get errors like this one.

like image 64
Shai Avatar answered Oct 18 '25 04:10

Shai



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!