Hi,
The .data should not be necessary as you’re in a no_grad() block. Same for setting the paremeters not to require gradients.
How do you measure memory usage?
Can you give a bit more context on your code? Does the model save some states by any chance?
Or do you save some outputs for later processing?