Hi,
You don’t want to use .data as it breaks the computational graph and so your gradients won’t be correct.
If you just want to keep a bunch of states, the simplest is to keep them in a python list.
There is no speed advantage in reusing a single buffer in most cases as the custom allocator we use will make the tensors creations almost free.
For the very slow backward, keep in mind that if you do 10 different forwards through your network, it will need to do 10 different backwards which can take a while as the computational graph is quite big.
If you don’t want gradient to flow back, you can use .detach() to prevent that.