Save model as string

Hi all,

is there a simple way that allows me to save a trained model as some kind of string so that I can copy the string manually to a new script loading it without saving/loading files?



In python, when you save the model, you don’t actually save the code.
The state_dict only contains the weights of your network.

So you can keep your code and copy/paste the values of the Tensors. But that might be too many to be possible to do.