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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With