Skip to content

Commit 99cb232

Browse files
committed
Rename function
1 parent 5176202 commit 99cb232

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pytorch_lightning/trainer/progress.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def state_dict(self) -> dict:
2828
return self.__getstate__()
2929

3030
@classmethod
31-
def load_state_dict(cls, state_dict: dict) -> "_DataclassStateDictMixin":
31+
def from_state_dict(cls, state_dict: dict) -> "_DataclassStateDictMixin":
3232
obj = cls()
3333
obj.__setstate__(state_dict)
3434
return obj

tests/trainer/test_progress.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def test_fit_loop_progress_serialization():
191191
}
192192
}
193193
# yapf: enable
194-
new_loop = FitLoopProgress.load_state_dict(state_dict)
194+
new_loop = FitLoopProgress.from_state_dict(state_dict)
195195
assert fit_loop == new_loop
196196

197197

@@ -214,5 +214,5 @@ def test_epoch_loop_progress_serialization():
214214
}
215215
}
216216
# yapf: enable
217-
new_loop = EpochLoopProgress.load_state_dict(state_dict)
217+
new_loop = EpochLoopProgress.from_state_dict(state_dict)
218218
assert loop == new_loop

0 commit comments

Comments
 (0)