This commit is contained in:
wls2002
2024-06-20 16:32:52 +08:00
parent 9f72813c35
commit 075460f896
17 changed files with 224 additions and 140 deletions

View File

@@ -36,6 +36,9 @@ class State:
def __setstate__(self, state):
self.__dict__["state_dict"] = state
def __contains__(self, item):
return item in self.state_dict
def tree_flatten(self):
children = list(self.state_dict.values())
aux_data = list(self.state_dict.keys())