That is the nice thing with having everything working just with Variables, you can move them around whatever way you want (plain variable, in a list, in a dictionnary, in a custom class…) and it will just work
Great, thank you! I didn’t experience any kind of slow down or such, so I figured, but since I am rather new to PyTorch and Python, I very much appreciate the assurance!
A Variable, like any instance of a class in Python isn’t actually copied when you add it to a list, the list just contains references to the Variables that you put into it. The underlying storage used for the data doesn’t get moved or copied.