mirror of
https://github.com/microsoft/qlib.git
synced 2026-07-11 23:06:58 +08:00
add finetune example & fix serial bug
This commit is contained in:
@@ -8,11 +8,11 @@ import pickle
|
||||
class Serializable:
|
||||
"""
|
||||
Serializable behaves like pickle.
|
||||
But it only save the state whose name starts with `_`
|
||||
But it only saves the state whose name **does not** start with `_`
|
||||
"""
|
||||
|
||||
def __getstate__(self) -> dict:
|
||||
return {k: v for k, v in self.__dict__.items() if k.startswith("_")}
|
||||
return {k: v for k, v in self.__dict__.items() if not k.startswith("_")}
|
||||
|
||||
def __setstate__(self, state: dict):
|
||||
self.__dict__.update(state)
|
||||
|
||||
Reference in New Issue
Block a user