def save ( self , fname : str ) : with open ( fname , "wb" ) as fp : pickle . dump ( self , fp )
python how to save object to pickle
Saves this training state to fname .
def save(self, fname: str):
        """
        Saves this training state to fname.
        """
        with open(fname, "wb") as fp:
            pickle.dump(self, fp)