Skip to content

Commit 1f1aad6

Browse files
committed
Fix state_dict passed to dcp.load (#3067)
1 parent 0e52e07 commit 1f1aad6

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

recipes_source/distributed_checkpoint_recipe.rst

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -253,13 +253,6 @@ The reason that we need the ``state_dict`` prior to loading is:
253253
optimizer = torch.optim.Adam(model.parameters(), lr=0.1)
254254
255255
state_dict = { "app": AppState(model, optimizer)}
256-
optimizer = torch.optim.Adam(model.parameters(), lr=0.1)
257-
# generates the state dict we will load into
258-
model_state_dict, optimizer_state_dict = get_state_dict(model, optimizer)
259-
state_dict = {
260-
"model": model_state_dict,
261-
"optimizer": optimizer_state_dict
262-
}
263256
dcp.load(
264257
state_dict=state_dict,
265258
checkpoint_id=CHECKPOINT_DIR,

0 commit comments

Comments
 (0)