Format code (#1169)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This commit is contained in:
github-actions[bot]
2023-09-02 16:14:32 +08:00
committed by GitHub
parent 0fc160c03e
commit c7bbf0bfd0
8 changed files with 136 additions and 69 deletions

View File

@@ -34,8 +34,10 @@ def load_checkpoint_d(checkpoint_path, combd, sbd, optimizer=None, load_opt=1):
new_state_dict[k] = saved_state_dict[k]
if saved_state_dict[k].shape != state_dict[k].shape:
logger.warn(
"shape-%s-mismatch. need: %s, get: %s"
, k, state_dict[k].shape, saved_state_dict[k].shape
"shape-%s-mismatch. need: %s, get: %s",
k,
state_dict[k].shape,
saved_state_dict[k].shape,
) #
raise KeyError
except:
@@ -110,8 +112,10 @@ def load_checkpoint(checkpoint_path, model, optimizer=None, load_opt=1):
new_state_dict[k] = saved_state_dict[k]
if saved_state_dict[k].shape != state_dict[k].shape:
logger.warn(
"shape-%s-mismatch|need-%s|get-%s"
, k, state_dict[k].shape, saved_state_dict[k].shape
"shape-%s-mismatch|need-%s|get-%s",
k,
state_dict[k].shape,
saved_state_dict[k].shape,
) #
raise KeyError
except: